AXIS2 / C and ONVIF

I am trying to create a wsdl stub 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 
+6
source share
2 answers

This error, usually caused by a tool, cannot find a service item in WSDL. Because in the definition of WSDL, it must have a specific endpoint. Check the WSDL for a service element in it, or if any other imported WSDL has a service element.

So, to get rid of this, you must define the endpoint in this WSDL.

0
source

I used the hack used on python-zeep , but it also helps with the 2 / c axis:

Add this to devicemgmt.wsdl, before the closing 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 trouble creating code using any of the variable bindings ("XSD complexType with mixed content not supported in ADB"). I had to disable it as follows:

 ./WSDL2C.sh -o ../axis2c-test/gen -d none -uri devicemgmt.wsdl 
0
source

Source: https://habr.com/ru/post/895601/


All Articles