I'm trying to create the stub of the wsdl http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl using AXIS2/C (c++), using the following command:
./WSDL2CPP.sh -uri http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
and I get the following answer:
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:153)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2CPP.main(WSDL2CPP.java:19)
Caused by: org.apache.axis2.AxisFault: **`No service was not found in the WSDL at http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl with targetnamespace http://www.onvif.org/ver10/device/wsdl`**
at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:115)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:147)
... 2 more
I used the hack used on python-zeep, but it helps with axis2/c as well:
Add this to devicemgmt.wsdl, just before the close tag "</wsdl:definitions>":
<wsdl:service name="DeviceService">
<wsdl:port name="DevicePort" binding="tds:DeviceBinding">
<soap:address location="http://192.168.1.100/onvif/device_service"/>
</wsdl:port>
</wsdl:service>
However, I'm still having problems generating the code with any of the variable bindings ("XSD complexType with mix content not supported in ADB"). I had to disable it as follows:
./WSDL2C.sh -o ../axis2c-test/gen -d none -uri devicemgmt.wsdl
This error normally coming because of the tool cannot find a service element in the WSDL. Because in WSDL definition it has to have a endpoint defined. Please check your WSDL whether it has a service element included or any other imported WSDL has the service element.
So basically to get rid of this you have to define a endpoint in this WSDL.
Related
I'm trying to write a client for Outlook.com mail. I've successfully connected and authenticated, and downloaded the WSDL. However, the WSDL has no service element, which the specification requires.
I dutifully checked all the imports per the question "wsdl has no service element" even though they're called messages.xsd and types.xsd, and found no service elements.
This page on Google Code describes the issue.
The service element is missing, presumably so they can distribute a single Services.wsdl that will work on all servers without having to customize it. I'm not sure of the reasoning.
The net effect is that you have to add the element yourself to the end of the file:
...
<wsdl:service name="ExchangeServices">
<wsdl:port name="ExchangeServicePort" binding="tns:ExchangeServiceBinding">
<soap:address location="https://my.exchange.com/EWS/Exchange.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
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)
This problem is present in mule 1.3.2-201212121943
WSDL soap:address location is not correctly rewritten by web-service-proxy with .NET WS
<mule ...>
<https:connector name="HTTP_HTTPS" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" doc:name="HTTP\HTTPS">
<https:tls-client path="xyz\keystore.jks" storePassword="mulepassword"/>
</https:connector>
<pattern:web-service-proxy name="xyz-ws-proxy" >
<http:inbound-endpoint address="http://localhost:8081"/>
<https:outbound-endpoint followRedirects="true" address="https://xyz/g2g/BPM#[header:inbound:http.request.path]" connector-ref="HTTP_HTTPS" />
</pattern:web-service-proxy>
</mule>
http://localhost:8081/xyz.asmx?wsdl returns wsdl with
<wsdl:port name="XYZEndpointSoap" binding="tns:XYZEndpointSoap">
<soap:address location="http://xyz/g2g/BPM/xyz.asmx" />
</wsdl:port>
<wsdl:port name="XYZEndpointSoap12" binding="tns:XYZEndpointSoap12">
<soap12:address location="http://xyzg2g/BPM/xyz.asmx" />
</wsdl:port>
With another jax-ws service, this configuration works - there was only one soap:address hmm.
This is .NET WS.
Thank you
PS: I have read google results and closed mule issues but nothing works for this service.
I have checked and pattern:web-service-proxy has no problem rewrite all the addresses of a WSDL that contains both a soap:address and a soap12:address.
The issue could actually be due to the way you get the WSDL: with the HTTP inbound endpoint bound to http://localhost:8081 with no path (something I would advocate against: it's better to have a path), the WSDL is available at http://localhost:8081/?wsdl, not http://localhost:8081/xyz.asmx?wsdl.
I am getting the following error when using CXF to consume a web service. The exception message is:
No binding factory for namespace http://schemas.xmlsoap.org/wsdl/http/ registered.
The WSDL service which I am trying to consume is:
<wsdl:service name="MyService">
<wsdl:port name="MyServiceHttpport" binding="impl:MyServiceHttpBinding">
<http:address location="http://localhost:80/ip/services/MyService"/>
</wsdl:port>
</wsdl:service
As seen above, there us http:address instead of soap:address
CXF doesn't support the WSDL http binding. The cxf-rt-bindings-http module has been removed from the recent CXF releases as it was relatively proprietary and is now replaced with all the REST goodness of the JAX-RS frontend.
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.