c++ - AXIS2/C 和 ONVIF

标签 c++ wso2 onvif axis2c

我正在尝试创建 wsdl 的 stub http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl使用 AXIS2/C (c++),使用以下命令:

./WSDL2CPP.sh -uri http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl

我得到以下答案:

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

最佳答案

我使用了 hack used on python-zeep ,但它对 axis2/c 也有帮助:

将此添加到 devicemgmt.wsdl,就在关闭标记“”之前:

<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>

但是,我在使用任何变量绑定(bind)生成代码时仍然遇到问题(“XSD complexType with mix content with mix content not supported in ADB”)。我不得不按如下方式禁用它:

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

关于c++ - AXIS2/C 和 ONVIF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7149502/

相关文章:

c++ - 多态显式模板实例化

c++ - 后台线程中的grpc服务器c++

c# - 无法加载文件或程序集 'video.player.net.dll' 或其依赖项之一。找不到指定的模块 .":"video.player.net.dll

c - 为什么RTSP播放命令在RTP端口收到设备篡改数据包?

java - ONVIF - 设备发现的开始

c++ - Linux套接字编程: read data by SIGIO

c++ - 如何在 C++ 中处理堆

wso2 - 身份验证框架 WSO2 IS 中的异常

tomcat - WSO2:Carbon 应用程序服务器和 tomcat 管理器应用程序

mysql - WSO2 治理 REGDB