使用wsdl2cpp生成工作的Onvif代码

时间:2013-05-13 14:02:25

标签: c++ axis2 wso2 onvif wsdl2code

我使用

从cmd生成了DeviceMgmt存根
WSDL2CPP.bat -uri http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl -u -d adb -o OutputDirectory

第一次,我收到一条错误,例如“找不到服务”,我通过添加以下内容解决了这个错误:

<wsdl:service name="OnvifService">
  <wsdl:port name="OnvifEndpoint" binding="DeviceBinding">
    <soap:address location="http://www.onvif.org/ver10/device/wsdl"/>
  </wsdl:port>
</wsdl:service>

在devicemgmt.wsdl

我在VS2012中打开了生成的项目,并将项目配置类型设置为动态库。编译之后我遇到了很多错误:

Error   907 error C2065: 'element' : undeclared identifier  d:\projects\onvif\devicemgmtservice\src\unsupportedpolicyrequestfaulttype.cpp   878
Error   1725    error C2143: syntax error : missing ';' before '*'  d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h    46
Error   1726    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h    46
Error   1731    error C2061: syntax error : identifier 'axutil_duration_t'  d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h    206
Error   2872    error C2143: syntax error : missing ';' before '*'  d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h    46
Error   2873    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h    46  error C2660: 'axutil_base64_binary_set_encoded_binary' : function does not take 1 arguments d:\projects\onvif\devicemgmtservice\src\motionincells.cpp   343
Error   4114    error C2059: syntax error : ')' d:\projects\onvif\devicemgmtservice\src\motionincells.cpp   344
Error   4256    error C2065: 'cp' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp  81
Error   4257    error C2065: 'cp' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp  83
Error   4258    error C2065: 'cp' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp  85
Error   4259    error C2065: 'cp' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp  86
Error   4260    error C2065: 'cp' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp  100
Error   4261    error C2065: 'cp' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp  108
Error   4262    error C2664: 'axutil_qname_free' : cannot convert parameter 1 from 'void *' to 'axutil_qname *' d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp  416
Error   4695    error C2065: 'element' : undeclared identifier  d:\projects\onvif\devicemgmtservice\src\invalidfilterfaulttype.cpp  878
Error   6379    error C2065: 'env' : undeclared identifier  d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 88
Error   6380    error C2227: left of '->allocator' must point to class/struct/union/generic type    d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 88
Error   6381    error C2227: left of '->malloc_fn' must point to class/struct/union/generic type    d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 88
Error   6382    error C2065: 'prefix' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 89
Error   6383    error C2065: 'prefix' : undeclared identifier   d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 90
Error   6518    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h    46
Error   6523    error C2061: syntax error : identifier 'axutil_duration_t'  d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h    206
Error   6524    error C3861: 'axutil_duration_create_from_string': identifier not found d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  132
Error   6525    error C2039: '_duration' : is not a member of 'org_xmlsoap_schemas_soap_envelope::AbsoluteOrRelativeTimeType::<unnamed-type-memberType>'    d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  229
Error   6526    error C3861: 'axutil_duration_serialize_duration': identifier not found d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  229
Error   6527    error C2143: syntax error : missing ';' before '*'  d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  437
Error   6528    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  437
Error   6529    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  439
Error   6530    error C2039: '_duration' : is not a member of 'org_xmlsoap_schemas_soap_envelope::AbsoluteOrRelativeTimeType::<unnamed-type-memberType>'    d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  442
Error   6531    error C2059: syntax error : ')' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  444
Error   6532    error C2065: 'member_type' : undeclared identifier  d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp  448
Error   6539    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_registry.h  65
Error   6540    error C2061: syntax error : identifier 'neethi_operator_t'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_assertion.h 179
Error   6541    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    58
Error   6542    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    58
Error   6543    error C2086: 'int neethi_policy_t' : redefinition   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    58
Error   6544    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    62
Error   6545    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    79
Error   6546    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    79
Error   6547    error C2086: 'int neethi_policy_t' : redefinition   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    79
Error   6548    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    83
Error   6549    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    83
Error   6550    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    103
Error   6551    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    103
Error   6552    error C2086: 'int neethi_policy_t' : redefinition   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    103
Error   6553    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    106
Error   6554    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    108
Error   6555    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    122
Error   6556    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    122
Error   6557    error C2086: 'int neethi_policy_t' : redefinition   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    122
Error   6558    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    125
Error   6559    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    126
Error   6560    error C2065: 'policy' : undeclared identifier   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    136
Error   6561    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h    137
Error   6562    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  38
Error   6563    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  38
Error   6564    error C2086: 'int neethi_policy_t' : redefinition   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  38
Error   6565    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  41
Error   6566    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  43
Error   6567    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  43
Error   6568    error C2086: 'int neethi_policy_t' : redefinition   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  43
Error   6569    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h  46
Error   6570    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 53
Error   6571    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 53
Error   6572    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 60
Error   6573    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 60
Error   6575    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 66
Error   6576    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h    84
Error   6577    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h    84
Error   6586    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h    386
Error   6587    error C2071: 'wso2wsf::ServiceClient::axis2_svc_client_t' : illegal storage class   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h    386
Error   6588    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h    386
Error   6590    error C2378: 'neethi_policy_t' : redefinition; symbol cannot be overloaded with a typedef   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    38
Error   6591    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    40
Error   6592    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    40
Error   6593    error C2086: 'int neethi_policy_t' : redefinition   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    40
Error   6594    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    42
Error   6595    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    46
Error   6596    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    47
Error   6597    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    51
Error   6598    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    52
Error   6599    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    56
Error   6600    error C2065: 'arraylist' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    57
Error   6601    error C2275: 'axutil_array_list_t' : illegal use of this type as an expression  d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    57
Error   6602    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    58
Error   6603    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    62
Error   6604    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    63
Error   6605    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    68
Error   6606    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    69
Error   6607    error C2065: 'normalized_neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    73
Error   6608    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    74
Error   6609    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    78
Error   6610    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    79
Error   6611    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    83
Error   6612    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    84
Error   6613    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    88
Error   6614    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    89
Error   6615    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    94
Error   6616    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    95
Error   6617    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    99
Error   6618    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    100
Error   6619    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    105
Error   6620    error C2065: 'parent' : undeclared identifier   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    106
Error   6621    error C2275: 'axiom_node_t' : illegal use of this type as an expression d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    106
Error   6622    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    107
Error   6623    error C2065: 'policy' : undeclared identifier   d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    111
Error   6624    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    112
Error   6625    error C2065: 'neethi_policy' : undeclared identifier    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    117
Error   6626    error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h    118
Error   6627    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_svc_client.h 602
Error   6628    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_policy_include.h 110
Error   6629    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_policy_include.h 117
Error   6630    error C2061: syntax error : identifier 'neethi_policy_t'    d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_policy_include.h 124
Error   6631    error C2143: syntax error : missing ';' before '*'  d:\wso\wso2-

是否有人使用WSO2为Onvif生成工作代码?我做错了什么?

2 个答案:

答案 0 :(得分:0)

没有尝试过使用WSO2,但已经使用过svcutil.exe。

我使用Visual Studio 2012添加了我的客户端代理,

  1. 添加新项目,新的ClassLibrary
  2. 解决方案资源管理器中的
  3. 使用添加新服务引用上下文菜单
  4. 在地址中,将网址用于wsdl http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
  5. Clik Go
  6. 选择一个合适的名称,例如OnvifDeviceService。
  7. Clik Ok
  8. 这将自动为您生成代理。 请注意Onvif正在使用Soap12,因此basicHttpBinding在窗口之外,因为它使用了Soap1.1。

    使用WsHttpBinding或自定义绑定连接到您的设备。

    使用内置方法扫描设备。 添加对System.ServiceModel.Discovery程序集的引用,此代码将扫描您的网络以查找设备。必须实现对onvif设备的一些过滤。

    private FindResponse ScanNetwork(string scopeMathcBy, int iTimeoutMilliseconds)
        {
            ServicePointManager.Expect100Continue = false;
    
            UdpDiscoveryEndpoint oUdpDiscoveryEndpoint = new UdpDiscoveryEndpoint(DiscoveryVersion.WSDiscoveryApril2005);
            DiscoveryClient oDiscoveryClient = new DiscoveryClient(oUdpDiscoveryEndpoint);
    
            // Create FindCriteria 
            var findCriteria = new FindCriteria
            {
                Duration = TimeSpan.FromMilliseconds(iTimeoutMilliseconds)
            };
            if (scopeMathcBy != null)
            {
                findCriteria.ScopeMatchBy = new Uri(scopeMathcBy);
            }
    
            var findResponse = oDiscoveryClient.Find(findCriteria);
            return findResponse;
        }
    

答案 1 :(得分:0)

解决!问题在于包含顺序。我重新安排了#include指令,并添加了一些包含所需的内容。但是在那里仍然有2个错误,只需查看生成的代码即可轻松删除。