Cannot compile Gsoap 2.8.123 using WS-Security on c++ - c++

I want use messages in http://www.onvif.org/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl
From cmd prompt I run Wsdl2h and soapcpp2, they generate the cpp files that I included in my project.
Then I compile my project following those instruction:
https://www.genivia.com/examples/onvif/index.html (Using WS-Security)
The project is not built I've 657 errors in wsseapi.cpp:
it doesn't recognize wsse__Security in struct soap inside soap file wsseapi.cpp
Has someone faced this problem?
I tried to disable SSL security and the project is built with no error, but I need enable SSL using WS-Security.
I'm expecting that there are some configuration in soap to manage this situation.

Related

SOAP UI 5.7.0: Error The server selected protocol version TLS10 is not accepted by client preferences [TLS12]

In SOAP latest version 5.7.0, trying to check SOAP request for java based application. But, getting below error. Tried multiple options provided over stack overflow to update "set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.https.protocols="TLSv1.2" in soapui batch file and "-Dsoapui.https.protocols=TLSv1.2" in SoapUI-5.7.0.vmoptions file. Also, try to update same at java level as well. Still same issue is occuring.
ERROR:Exception in request: javax.net.ssl.SSLHandshakeException: The server selected protocol version TLS10 is not accepted by client preferences [TLS12]
FYI, this was working in previous version of SOAP but after upgrade same thing is not working as expected.
It will be helpful that solution is provided for same.
Solution on TLS related error in latest SOAP UI 5.7.0
Try with following:
Open "C:\Program Files\SmartBear\SoapUI-5.7.0\bin\SoapUI-5.7.0.vmoptions"
Append -Dweblogic.security.SSL.minimumProtocolVersion=TLSv1.0 if it's not there already.
Then Open "C:\Program Files\SmartBear\SoapUI-5.7.0\jre\conf\security\java.security"
Find jdk.tls.disabledAlgorithms, either comment it with # or remove specific versions, e.g. TLSv1, TLSv1.1
Restart SoapUI and try again.

Stub client generation Apache CXF

I am seeing one behavior while accessing one wsdl. I used Apache Axis 1.3 as well as JAX-WS wsimport tool to generate client stubs, it is successfully generating stubs.
But when I am using apache-cxf-2.7.18 and using wsdl2java command, it's not generating stubs, giving me error.
WSDL is on https. I added proxy in wsdl2java bat file as well. wsdl contains a which is also on https.
Error I am getting like:
enter image description here
It seems to that it's not able to include underlying wsdl.
Can anybody give me any pointer what I am doing wrong?
I believe, when I am doing any service publishing, it can not be client implementation specific like it is supported by Axis but not CXF. or I can do that? Is there any restriction that could be applied?
(Solution in comments)
The error log shows a connection error when downloading the WSDL, probably due to a misconfiguration of the proxy in wsdl2java when using a SSL connection through maven
Maven is not is not able to download imports using the proxy configuration, since you have downloaded the wsdl, you can also download all referenced url resources to local files and change <wsdl:import location= to use each local file. Use a relative path ./yourfile or a URL format file://path/to/the/file

gSOAP C++ code on Windows vs Linux

I'm using gSOAP with EWS via proxy services to connect to Exchange services. I've fully working C++ gSOAP code for sending message on Windows, but when I compile and run the same code on Ubuntu, I've got 401 Unauthorized Error, Why?
On Windows:
I've used the binaries of soapcpp2.exe and wsdl2h.exe to generate header files etc.
For compile and run: I'm using MobaXterm (a kind of Terminal)
Please anyone who are familiar with gSOAP help me to figure out the possible problem. Many thanks in advance.
The 401 Unauthorized Error requires HTTP authentication, either with HTTPS and basic authentication or with HTTP digest authentication. The proxy also likely requires authentication.
See the tutorial on HTTP Digest Authentication

Problems with web service, Axis2 and Rampart

I'm new with the Web services and I have a problem obtaining the java files from a WSDL.
The devs of the servers gave me this information:
I have to generate the source with a xmlbeans binding using Axis2 and Rampart. The requests must be signed with a trusted certificate (I have one) and add a Timestamp.
That said, I downloaded the lastest versions of Axis2 and Rampart and executed the next command line without getting errors:
wsdl2java -d xmlbeans -uri https://juntadeandalucia.e-factura.net/puef/services/SSPPWebServiceProxyService?wsdl -o .\src\
I don't have a clue about how to configure Rampart (just copied the modules in repository/modules, inside Axis2 directory) and I don't know if it varies the result neither. The case is that, following the Apache web examples, I can't use the java source generated as is.
For example, to use the consultarFactura method I would need to write a source like this, following the Apache web examples:
SSPPWebServiceProxyServiceStub webservice = new
SSPPWebServiceProxyServiceStub(url); ConsultarFacturaDocument doc =
ConsultarFacturaDocument.Factory.newInstance();
doc.setNumeroRegistro(numeroRegistro); return
webservice.consultarFactura(doc); //Return the response
But setNumeroRegistro() its not a method of ConsultarFacturaDocument (witch is an interface), its a method of another interface called ConsultarFactura defined inside the first one.
wsdl2java gave me a wrong or incomplete code?
I have to do something more before generating the code?
Can I use another framework to generate a more clean code? (I tried cxf, but wsdl2java gave me errors, using the xmlbeans binding or not).
Any help would be highly appreciated.
(Sorry for my bad english)

wsimport - Two declarations cause a collision in the ObjectFactory class

Trying to use wsimport to generate a client for a SOAP endpoint. wsdl was published by one of our clients. I am getting the below error when I am using wsimport or cxf , if I am using Axis2 the binding are generated properly.
Could anyone please offer any advice for how to get this to work?
Command Used :
wsimport -s src -d bin wsdlurl
Error:
parsing WSDL...
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1 of wsdlurl?xsd=xsd4
[wsimport] [WARNING] unknown extensibility element or attribute "EndpointReference" (in namespace "http://www.w3.org/2005/08/addressing")
The Error is due to improper xsd formation in wsdl.
I have used NetBeans to generate the Webservice client .
When we try to generate the client Bindings it will give error, we need to change
the xsd files located in NetBeans Project
\NetBeansProject\src\META-INF\wsdl\packgestructure\wcflib-tc
and copy them to xmlresources path
\NetBeansProject\xml-resources\web-service-references\service\wsdl\packagestructure\wcflib-tc\ Folder and Refresh the service in project NetBeans client binding will be generated.