【问题标题】:AXIS2/C and ONVIFAXIS2/C 和 ONVIF
【发布时间】:2011-08-22 15:06:27
【问题描述】:

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

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

【问题讨论】:

    标签: c++ wso2 onvif axis2c


    【解决方案1】:

    我使用了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>
    

    但是,我仍然在使用任何变量绑定生成代码时遇到问题(“ADB 中不支持混合内容的 XSD complexType”)。我不得不按如下方式禁用它:

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

    【讨论】:

      【解决方案2】:

      这个错误通常是因为工具在 WSDL 中找不到服务元素。因为在 WSDL 定义中它必须定义一个端点。请检查您的 WSDL 是否包含服务元素或任何其他导入的 WSDL 具有服务元素。

      所以基本上要摆脱这种情况,您必须在此 WSDL 中定义一个端点。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-10-08
        • 1970-01-01
        • 1970-01-01
        • 2021-05-11
        • 2015-12-23
        • 2011-07-02
        • 2018-01-06
        相关资源
        最近更新 更多