Gsoap 集成多个ONVIF服务(DeviceMgmt service)

说明:

本文使用Gsoap 2.8.9 ,VS2010,win7
所有代码可以到这里下载
另外由于时间有限,整个VS2010 solution第一次编译可能不通过,大家再编译一次就好了

前文:

基于Gsoap 集成多个ONVIF服务(ws-discovery)


1. 生成DeviceMgmt service 服务server/client端代码,使用C++命名空间“DeviceMgmt”
如果用win7,最好用管理员权限打开"cmd",确保修改后的typemap.dat位于gsoap/bin/win32下面
cd gsoap/bin/win32
wsdl2h -o onvif.h -ttypemap.dat http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
soapcpp2 onvif.h -i -x -qDeviceMgmt -I../../import -I../../


2.修改“DeviceMgmtStub.h”
删除图中“WITH_NOGLOBAL”定义



3. 修改“DeviceMgmtH.h”部分SOAP_TYPE_DeviceMgmt_xsd__duration 宏定义,直接生成的代码貌似使用“xsd__duration”,实质上是long64
用以下代码替换替换“soap_default_xsd__duration”,“soap_out_xsd__duration”,“soap_in_xsd__duration”

#define soap_default_xsd__duration(soap, a) soap_default_unsignedLONG64(soap, (ULONG64 *)a)

SOAP_FMAC3S const char* SOAP_FMAC4S soap_xsd__duration2s(struct soap*, LONG64);
#define soap_out_xsd__duration(soap,a,b,c,d) soap_out_unsignedLONG64(soap, a, b, (ULONG64 *)c, d)

SOAP_FMAC3S int SOAP_FMAC4S soap_s2xsd__duration(struct soap*, const char*, LONG64 *);
#define soap_in_xsd__duration(soap, a, b, c) (LONG64*)soap_in_unsignedLONG64(soap,a,(ULONG64 *)b,c)

4.DeviceMgmtDeviceBindingService.cpp 文件修改

1)添加service端回调函数,注意将代码放置于命名空间内

/// Web service operation 'GetServices' (returns error code or SOAP_OK)
int DeviceBindingService::GetServices(_tds__GetServices *tds__GetServices, _tds__GetServicesResponse *tds__GetServicesResponse) {return -1;}

/// Web service operation 'GetServiceCapabilities' (returns error code or SOAP_OK)
int DeviceBindingService::GetServiceCapabilities(_tds__GetServiceCapabilities *tds__GetServiceCapabilities, _tds__GetServiceCapabilitiesResponse *tds__GetServiceCapabilitiesResponse) {return -1;}

/// Web service operation 'GetDeviceInformation' (returns error code or SOAP_OK)
int DeviceBindingService::GetDeviceInformation(_tds__GetDeviceInformation *tds__GetDeviceInformation, _tds__GetDeviceInformationResponse *tds__GetDeviceInformationResponse) {return -1;}

/// Web service operation 'SetSystemDateAndTime' (returns error code or SOAP_OK)
int DeviceBindingService::SetSystemDateAndTime(_tds__SetSystemDateAndTime *tds__SetSystemDateAndTime, _tds__SetSystemDateAndTimeResponse *tds__SetSystemDateAndTimeResponse) {return -1;}

/// Web service operation 'GetSystemDateAndTime' (returns error code or SOAP_OK)
int DeviceBindingService::GetSystemDateAndTime(_tds__GetSystemDateAndTime *tds__GetSystemDateAndTime, _tds__GetSystemDateAndTimeResponse *tds__GetSystemDateAndTimeResponse) {return -1;}

/// Web service operation 'SetSystemFactoryDefault' (returns error code or SOAP_OK)
int DeviceBindingService::SetSystemFactoryDefault(_tds__SetSystemFactoryDefault *tds__SetSystemFactoryDefault, _tds__SetSystemFactoryDefaultResponse *tds__SetSystemFactoryDefaultResponse) {return -1;}

/// Web service operation 'UpgradeSystemFirmware' (returns error code or SOAP_OK)
int DeviceBindingService::UpgradeSystemFirmware(_tds__UpgradeSystemFirmware *tds__UpgradeSystemFirmware, _tds__UpgradeSystemFirmwareResponse *tds__UpgradeSystemFirmwareResponse) {return -1;}

/// Web service operation 'SystemReboot' (returns error code or SOAP_OK)
int DeviceBindingService::SystemReboot(_tds__SystemReboot *tds__SystemReboot, _tds__SystemRebootResponse *tds__SystemRebootResponse) {return -1;}

/// Web service operation 'RestoreSystem' (returns error code or SOAP_OK)
int DeviceBindingService::RestoreSystem(_tds__RestoreSystem *tds__RestoreSystem, _tds__RestoreSystemResponse *tds__RestoreSystemResponse) {return -1;}

/// Web service operation 'GetSystemBackup' (returns error code or SOAP_OK)
int DeviceBindingService::GetSystemBackup(_tds__GetSystemBackup *tds__GetSystemBackup, _tds__GetSystemBackupResponse *tds__GetSystemBackupResponse) {return -1;}

/// Web service operation 'GetSystemLog' (returns error code or SOAP_OK)
int DeviceBindingService::GetSystemLog(_tds__GetSystemLog *tds__GetSystemLog, _tds__GetSystemLogResponse *tds__GetSystemLogResponse) {return -1;}

/// Web service operation 'GetSystemSupportInformation' (returns error code or SOAP_OK)
int DeviceBindingService::GetSystemSupportInformation(_tds__GetSystemSupportInformation *tds__GetSystemSupportInformation, _tds__GetSystemSupportInformationResponse *tds__GetSystemSupportInformationResponse) {return -1;}

/// Web service operation 'GetScopes' (returns error code or SOAP_OK)
int DeviceBindingService::GetScopes(_tds__GetScopes *tds__GetScopes, _tds__GetScopesResponse *tds__GetScopesResponse) {return -1;}

/// Web service operation 'SetScopes' (returns error code or SOAP_OK)
int DeviceBindingService::SetScopes(_tds__SetScopes *tds__SetScopes, _tds__SetScopesResponse *tds__SetScopesResponse) {return -1;}

/// Web service operation 'AddScopes' (returns error code or SOAP_OK)
int DeviceBindingService::AddScopes(_tds__AddScopes *tds__AddScopes, _tds__AddScopesResponse *tds__AddScopesResponse) {return -1;}

/// Web service operation 'RemoveScopes' (returns error code or SOAP_OK)
int DeviceBindingService::RemoveScopes(_tds__RemoveScopes *tds__RemoveScopes, _tds__RemoveScopesResponse *tds__RemoveScopesResponse) {return -1;}

/// Web service operation 'GetDiscoveryMode' (returns error code or SOAP_OK)
int DeviceBindingService::GetDiscoveryMode(_tds__GetDiscoveryMode *tds__GetDiscoveryMode, _tds__GetDiscoveryModeResponse *tds__GetDiscoveryModeResponse) {return -1;}

/// Web service operation 'SetDiscoveryMode' (returns error code or SOAP_OK)
int DeviceBindingService::SetDiscoveryMode(_tds__SetDiscoveryMode *tds__SetDiscoveryMode, _tds__SetDiscoveryModeResponse *tds__SetDiscoveryModeResponse) {return -1;}

/// Web service operation 'GetRemoteDiscoveryMode' (returns error code or SOAP_OK)
int DeviceBindingService::GetRemoteDiscoveryMode(_tds__GetRemoteDiscoveryMode *tds__GetRemoteDiscoveryMode, _tds__GetRemoteDiscoveryModeResponse *tds__GetRemoteDiscoveryModeResponse) {return -1;}

/// Web service operation 'SetRemoteDiscoveryMode' (returns error code or SOAP_OK)
int DeviceBindingService::SetRemoteDiscoveryMode(_tds__SetRemoteDiscoveryMode *tds__SetRemoteDiscoveryMode, _tds__SetRemoteDiscoveryModeResponse *tds__SetRemoteDiscoveryModeResponse) {return -1;}

/// Web service operation 'GetDPAddresses' (returns error code or SOAP_OK)
int DeviceBindingService::GetDPAddresses(_tds__GetDPAddresses *tds__GetDPAddresses, _tds__GetDPAddressesResponse *tds__GetDPAddressesResponse) {return -1;}

/// Web service operation 'GetEndpointReference' (returns error code or SOAP_OK)
int DeviceBindingService::GetEndpointReference(_tds__GetEndpointReference *tds__GetEndpointReference, _tds__GetEndpointReferenceResponse *tds__GetEndpointReferenceResponse) {return -1;}

/// Web service operation 'GetRemoteUser' (returns error code or SOAP_OK)
int DeviceBindingService::GetRemoteUser(_tds__GetRemoteUser *tds__GetRemoteUser, _tds__GetRemoteUserResponse *tds__GetRemoteUserResponse) {return -1;}

/// Web service operation 'SetRemoteUser' (returns error code or SOAP_OK)
int DeviceBindingService::SetRemoteUser(_tds__SetRemoteUser *tds__SetRemoteUser, _tds__SetRemoteUserResponse *tds__SetRemoteUserResponse) {return -1;}

/// Web service operation 'GetUsers' (returns error code or SOAP_OK)
int DeviceBindingService::GetUsers(_tds__GetUsers *tds__GetUsers, _tds__GetUsersResponse *tds__GetUsersResponse) {return -1;}

/// Web service operation 'CreateUsers' (returns error code or SOAP_OK)
int DeviceBindingService::CreateUsers(_tds__CreateUsers *tds__CreateUsers, _tds__CreateUsersResponse *tds__CreateUsersResponse) {return -1;}

/// Web service operation 'DeleteUsers' (returns error code or SOAP_OK)
int DeviceBindingService::DeleteUsers(_tds__DeleteUsers *tds__DeleteUsers, _tds__DeleteUsersResponse *tds__DeleteUsersResponse) {return -1;}

/// Web service operation 'SetUser' (returns error code or SOAP_OK)
int DeviceBindingService::SetUser(_tds__SetUser *tds__SetUser, _tds__SetUserResponse *tds__SetUserResponse) {return -1;}

/// Web service operation 'GetWsdlUrl' (returns error code or SOAP_OK)
int DeviceBindingService::GetWsdlUrl(_tds__GetWsdlUrl *tds__GetWsdlUrl, _tds__GetWsdlUrlResponse *tds__GetWsdlUrlResponse) {return -1;}

/// Web service operation 'GetCapabilities' (returns error code or SOAP_OK)
int DeviceBindingService::GetCapabilities(_tds__GetCapabilities *tds__GetCapabilities, _tds__GetCapabilitiesResponse *tds__GetCapabilitiesResponse) {return -1;}

/// Web service operation 'SetDPAddresses' (returns error code or SOAP_OK)
int DeviceBindingService::SetDPAddresses(_tds__SetDPAddresses *tds__SetDPAddresses, _tds__SetDPAddressesResponse *tds__SetDPAddressesResponse) {return -1;}

/// Web service operation 'GetHostname' (returns error code or SOAP_OK)
int DeviceBindingService::GetHostname(_tds__GetHostname *tds__GetHostname, _tds__GetHostnameResponse *tds__GetHostnameResponse) {return -1;}

/// Web service operation 'SetHostname' (returns error code or SOAP_OK)
int DeviceBindingService::SetHostname(_tds__SetHostname *tds__SetHostname, _tds__SetHostnameResponse *tds__SetHostnameResponse) {return -1;}

/// Web service operation 'SetHostnameFromDHCP' (returns error code or SOAP_OK)
int DeviceBindingService::SetHostnameFromDHCP(_tds__SetHostnameFromDHCP *tds__SetHostnameFromDHCP, _tds__SetHostnameFromDHCPResponse *tds__SetHostnameFromDHCPResponse) {return -1;}

/// Web service operation 'GetDNS' (returns error code or SOAP_OK)
int DeviceBindingService::GetDNS(_tds__GetDNS *tds__GetDNS, _tds__GetDNSResponse *tds__GetDNSResponse) {return -1;}

/// Web service operation 'SetDNS' (returns error code or SOAP_OK)
int DeviceBindingService::SetDNS(_tds__SetDNS *tds__SetDNS, _tds__SetDNSResponse *tds__SetDNSResponse) {return -1;}

/// Web service operation 'GetNTP' (returns error code or SOAP_OK)
int DeviceBindingService::GetNTP(_tds__GetNTP *tds__GetNTP, _tds__GetNTPResponse *tds__GetNTPResponse) {return -1;}

/// Web service operation 'SetNTP' (returns error code or SOAP_OK)
int DeviceBindingService::SetNTP(_tds__SetNTP *tds__SetNTP, _tds__SetNTPResponse *tds__SetNTPResponse) {return -1;}

/// Web service operation 'GetDynamicDNS' (returns error code or SOAP_OK)
int DeviceBindingService::GetDynamicDNS(_tds__GetDynamicDNS *tds__GetDynamicDNS, _tds__GetDynamicDNSResponse *tds__GetDynamicDNSResponse) {return -1;}

/// Web service operation 'SetDynamicDNS' (returns error code or SOAP_OK)
int DeviceBindingService::SetDynamicDNS(_tds__SetDynamicDNS *tds__SetDynamicDNS, _tds__SetDynamicDNSResponse *tds__SetDynamicDNSResponse) {return -1;}

/// Web service operation 'GetNetworkInterfaces' (returns error code or SOAP_OK)
int DeviceBindingService::GetNetworkInterfaces(_tds__GetNetworkInterfaces *tds__GetNetworkInterfaces, _tds__GetNetworkInterfacesResponse *tds__GetNetworkInterfacesResponse) {return -1;}

/// Web service operation 'SetNetworkInterfaces' (returns error code or SOAP_OK)
int DeviceBindingService::SetNetworkInterfaces(_tds__SetNetworkInterfaces *tds__SetNetworkInterfaces, _tds__SetNetworkInterfacesResponse *tds__SetNetworkInterfacesResponse) {return -1;}

/// Web service operation 'GetNetworkProtocols' (returns error code or SOAP_OK)
int DeviceBindingService::GetNetworkProtocols(_tds__GetNetworkProtocols *tds__GetNetworkProtocols, _tds__GetNetworkProtocolsResponse *tds__GetNetworkProtocolsResponse) {return -1;}

/// Web service operation 'SetNetworkProtocols' (returns error code or SOAP_OK)
int DeviceBindingService::SetNetworkProtocols(_tds__SetNetworkProtocols *tds__SetNetworkProtocols, _tds__SetNetworkProtocolsResponse *tds__SetNetworkProtocolsResponse) {return -1;}

/// Web service operation 'GetNetworkDefaultGateway' (returns error code or SOAP_OK)
int DeviceBindingService::GetNetworkDefaultGateway(_tds__GetNetworkDefaultGateway *tds__GetNetworkDefaultGateway, _tds__GetNetworkDefaultGatewayResponse *tds__GetNetworkDefaultGatewayResponse) {return -1;}

/// Web service operation 'SetNetworkDefaultGateway' (returns error code or SOAP_OK)
int DeviceBindingService::SetNetworkDefaultGateway(_tds__SetNetworkDefaultGateway *tds__SetNetworkDefaultGateway, _tds__SetNetworkDefaultGatewayResponse *tds__SetNetworkDefaultGatewayResponse) {return -1;}

/// Web service operation 'GetZeroConfiguration' (returns error code or SOAP_OK)
int DeviceBindingService::GetZeroConfiguration(_tds__GetZeroConfiguration *tds__GetZeroConfiguration, _tds__GetZeroConfigurationResponse *tds__GetZeroConfigurationResponse) {return -1;}

/// Web service operation 'SetZeroConfiguration' (returns error code or SOAP_OK)
int DeviceBindingService::SetZeroConfiguration(_tds__SetZeroConfiguration *tds__SetZeroConfiguration, _tds__SetZeroConfigurationResponse *tds__SetZeroConfigurationResponse) {return -1;}

/// Web service operation 'GetIPAddressFilter' (returns error code or SOAP_OK)
int DeviceBindingService::GetIPAddressFilter(_tds__GetIPAddressFilter *tds__GetIPAddressFilter, _tds__GetIPAddressFilterResponse *tds__GetIPAddressFilterResponse) {return -1;}

/// Web service operation 'SetIPAddressFilter' (returns error code or SOAP_OK)
int DeviceBindingService::SetIPAddressFilter(_tds__SetIPAddressFilter *tds__SetIPAddressFilter, _tds__SetIPAddressFilterResponse *tds__SetIPAddressFilterResponse) {return -1;}

/// Web service operation 'AddIPAddressFilter' (returns error code or SOAP_OK)
int DeviceBindingService::AddIPAddressFilter(_tds__AddIPAddressFilter *tds__AddIPAddressFilter, _tds__AddIPAddressFilterResponse *tds__AddIPAddressFilterResponse) {return -1;}

/// Web service operation 'RemoveIPAddressFilter' (returns error code or SOAP_OK)
int DeviceBindingService::RemoveIPAddressFilter(_tds__RemoveIPAddressFilter *tds__RemoveIPAddressFilter, _tds__RemoveIPAddressFilterResponse *tds__RemoveIPAddressFilterResponse) {return -1;}

/// Web service operation 'GetAccessPolicy' (returns error code or SOAP_OK)
int DeviceBindingService::GetAccessPolicy(_tds__GetAccessPolicy *tds__GetAccessPolicy, _tds__GetAccessPolicyResponse *tds__GetAccessPolicyResponse) {return -1;}

/// Web service operation 'SetAccessPolicy' (returns error code or SOAP_OK)
int DeviceBindingService::SetAccessPolicy(_tds__SetAccessPolicy *tds__SetAccessPolicy, _tds__SetAccessPolicyResponse *tds__SetAccessPolicyResponse) {return -1;}

/// Web service operation 'CreateCertificate' (returns error code or SOAP_OK)
int DeviceBindingService::CreateCertificate(_tds__CreateCertificate *tds__CreateCertificate, _tds__CreateCertificateResponse *tds__CreateCertificateResponse) {return -1;}

/// Web service operation 'GetCertificates' (returns error code or SOAP_OK)
int DeviceBindingService::GetCertificates(_tds__GetCertificates *tds__GetCertificates, _tds__GetCertificatesResponse *tds__GetCertificatesResponse) {return -1;}

/// Web service operation 'GetCertificatesStatus' (returns error code or SOAP_OK)
int DeviceBindingService::GetCertificatesStatus(_tds__GetCertificatesStatus *tds__GetCertificatesStatus, _tds__GetCertificatesStatusResponse *tds__GetCertificatesStatusResponse) {return -1;}

/// Web service operation 'SetCertificatesStatus' (returns error code or SOAP_OK)
int DeviceBindingService::SetCertificatesStatus(_tds__SetCertificatesStatus *tds__SetCertificatesStatus, _tds__SetCertificatesStatusResponse *tds__SetCertificatesStatusResponse) {return -1;}

/// Web service operation 'DeleteCertificates' (returns error code or SOAP_OK)
int DeviceBindingService::DeleteCertificates(_tds__DeleteCertificates *tds__DeleteCertificates, _tds__DeleteCertificatesResponse *tds__DeleteCertificatesResponse) {return -1;}

/// Web service operation 'GetPkcs10Request' (returns error code or SOAP_OK)
int DeviceBindingService::GetPkcs10Request(_tds__GetPkcs10Request *tds__GetPkcs10Request, _tds__GetPkcs10RequestResponse *tds__GetPkcs10RequestResponse) {return -1;}

/// Web service operation 'LoadCertificates' (returns error code or SOAP_OK)
int DeviceBindingService::LoadCertificates(_tds__LoadCertificates *tds__LoadCertificates, _tds__LoadCertificatesResponse *tds__LoadCertificatesResponse) {return -1;}

/// Web service operation 'GetClientCertificateMode' (returns error code or SOAP_OK)
int DeviceBindingService::GetClientCertificateMode(_tds__GetClientCertificateMode *tds__GetClientCertificateMode, _tds__GetClientCertificateModeResponse *tds__GetClientCertificateModeResponse) {return -1;}

/// Web service operation 'SetClientCertificateMode' (returns error code or SOAP_OK)
int DeviceBindingService::SetClientCertificateMode(_tds__SetClientCertificateMode *tds__SetClientCertificateMode, _tds__SetClientCertificateModeResponse *tds__SetClientCertificateModeResponse) {return -1;}

/// Web service operation 'GetRelayOutputs' (returns error code or SOAP_OK)
int DeviceBindingService::GetRelayOutputs(_tds__GetRelayOutputs *tds__GetRelayOutputs, _tds__GetRelayOutputsResponse *tds__GetRelayOutputsResponse) {return -1;}

/// Web service operation 'SetRelayOutputSettings' (returns error code or SOAP_OK)
int DeviceBindingService::SetRelayOutputSettings(_tds__SetRelayOutputSettings *tds__SetRelayOutputSettings, _tds__SetRelayOutputSettingsResponse *tds__SetRelayOutputSettingsResponse) {return -1;}

/// Web service operation 'SetRelayOutputState' (returns error code or SOAP_OK)
int DeviceBindingService::SetRelayOutputState(_tds__SetRelayOutputState *tds__SetRelayOutputState, _tds__SetRelayOutputStateResponse *tds__SetRelayOutputStateResponse) {return -1;}

/// Web service operation 'SendAuxiliaryCommand' (returns error code or SOAP_OK)
int DeviceBindingService::SendAuxiliaryCommand(_tds__SendAuxiliaryCommand *tds__SendAuxiliaryCommand, _tds__SendAuxiliaryCommandResponse *tds__SendAuxiliaryCommandResponse) {return -1;}

/// Web service operation 'GetCACertificates' (returns error code or SOAP_OK)
int DeviceBindingService::GetCACertificates(_tds__GetCACertificates *tds__GetCACertificates, _tds__GetCACertificatesResponse *tds__GetCACertificatesResponse) {return -1;}

/// Web service operation 'LoadCertificateWithPrivateKey' (returns error code or SOAP_OK)
int DeviceBindingService::LoadCertificateWithPrivateKey(_tds__LoadCertificateWithPrivateKey *tds__LoadCertificateWithPrivateKey, _tds__LoadCertificateWithPrivateKeyResponse *tds__LoadCertificateWithPrivateKeyResponse) {return -1;}

/// Web service operation 'GetCertificateInformation' (returns error code or SOAP_OK)
int DeviceBindingService::GetCertificateInformation(_tds__GetCertificateInformation *tds__GetCertificateInformation, _tds__GetCertificateInformationResponse *tds__GetCertificateInformationResponse) {return -1;}

/// Web service operation 'LoadCACertificates' (returns error code or SOAP_OK)
int DeviceBindingService::LoadCACertificates(_tds__LoadCACertificates *tds__LoadCACertificates, _tds__LoadCACertificatesResponse *tds__LoadCACertificatesResponse) {return -1;}

/// Web service operation 'CreateDot1XConfiguration' (returns error code or SOAP_OK)
int DeviceBindingService::CreateDot1XConfiguration(_tds__CreateDot1XConfiguration *tds__CreateDot1XConfiguration, _tds__CreateDot1XConfigurationResponse *tds__CreateDot1XConfigurationResponse) {return -1;}

/// Web service operation 'SetDot1XConfiguration' (returns error code or SOAP_OK)
int DeviceBindingService::SetDot1XConfiguration(_tds__SetDot1XConfiguration *tds__SetDot1XConfiguration, _tds__SetDot1XConfigurationResponse *tds__SetDot1XConfigurationResponse) {return -1;}

/// Web service operation 'GetDot1XConfiguration' (returns error code or SOAP_OK)
int DeviceBindingService::GetDot1XConfiguration(_tds__GetDot1XConfiguration *tds__GetDot1XConfiguration, _tds__GetDot1XConfigurationResponse *tds__GetDot1XConfigurationResponse) {return -1;}

/// Web service operation 'GetDot1XConfigurations' (returns error code or SOAP_OK)
int DeviceBindingService::GetDot1XConfigurations(_tds__GetDot1XConfigurations *tds__GetDot1XConfigurations, _tds__GetDot1XConfigurationsResponse *tds__GetDot1XConfigurationsResponse) {return -1;}

/// Web service operation 'DeleteDot1XConfiguration' (returns error code or SOAP_OK)
int DeviceBindingService::DeleteDot1XConfiguration(_tds__DeleteDot1XConfiguration *tds__DeleteDot1XConfiguration, _tds__DeleteDot1XConfigurationResponse *tds__DeleteDot1XConfigurationResponse) {return -1;}

/// Web service operation 'GetDot11Capabilities' (returns error code or SOAP_OK)
int DeviceBindingService::GetDot11Capabilities(_tds__GetDot11Capabilities *tds__GetDot11Capabilities, _tds__GetDot11CapabilitiesResponse *tds__GetDot11CapabilitiesResponse) {return -1;}

/// Web service operation 'GetDot11Status' (returns error code or SOAP_OK)
int DeviceBindingService::GetDot11Status(_tds__GetDot11Status *tds__GetDot11Status, _tds__GetDot11StatusResponse *tds__GetDot11StatusResponse) {return -1;}

/// Web service operation 'ScanAvailableDot11Networks' (returns error code or SOAP_OK)
int DeviceBindingService::ScanAvailableDot11Networks(_tds__ScanAvailableDot11Networks *tds__ScanAvailableDot11Networks, _tds__ScanAvailableDot11NetworksResponse *tds__ScanAvailableDot11NetworksResponse) {return -1;}

/// Web service operation 'GetSystemUris' (returns error code or SOAP_OK)
int DeviceBindingService::GetSystemUris(_tds__GetSystemUris *tds__GetSystemUris, _tds__GetSystemUrisResponse *tds__GetSystemUrisResponse) {return -1;}

/// Web service operation 'StartFirmwareUpgrade' (returns error code or SOAP_OK)
int DeviceBindingService::StartFirmwareUpgrade(_tds__StartFirmwareUpgrade *tds__StartFirmwareUpgrade, _tds__StartFirmwareUpgradeResponse *tds__StartFirmwareUpgradeResponse) {return -1;}

/// Web service operation 'StartSystemRestore' (returns error code or SOAP_OK)
int DeviceBindingService::StartSystemRestore(_tds__StartSystemRestore *tds__StartSystemRestore, _tds__StartSystemRestoreResponse *tds__StartSystemRestoreResponse) {return -1;}

2)修改“(DeviceMgmt::SOAP_ENV__Header *)”部分


5.修改“DeviceMgmtDeviceBindingProxy.cpp”,


6.DeviceMgmtC.cpp
第24行,#ifndef WITH_NOGLOBAL 修改为#ifdef WITH_NOGLOBAL


7.找到gsoap/stdsoap2.cpp,修改
1) gsoap源代码有一个小bug,暂时屏蔽


2)由于每一个ONVIF serveice "namespace"可能不同,没有采用全局“namespace“




8.生成envC.cpp,原因可参考gsoap帮助文档“soapdoc2.html” 19.35部分
这一部分和ws-discovery 差不多,只不过header.h略有不同,

//gsoap h schema namespace: http://websrv.cs.fsu.edu/~engelen/h.xsd
struct wsa5__RelatesToType
{
public:
	char *__item;
	char *RelationshipType;	/* optional attribute of type wsa5:RelationshipTypeOpenEnum */
	char *__anyAttribute;	/* optional attribute of type xsd:anyType */
};

struct wsa5__ReferenceParametersType
{
public:
	int __size;	/* sequence of elements <-any> */
	char **__any;
	char *__anyAttribute;	/* optional attribute of type xsd:anyType */
};

struct wsa5__MetadataType
{
public:
	int __size;	/* sequence of elements <-any> */
	char **__any;
	char *__anyAttribute;	/* optional attribute of type xsd:anyType */
};

struct wsa5__EndpointReferenceType
{
public:
	char *Address;	/* required element of type xsd:string */
	struct wsa5__ReferenceParametersType *ReferenceParameters;	/* optional element of type wsa5:ReferenceParametersType */
	struct wsa5__MetadataType *Metadata;	/* optional element of type wsa5:MetadataType */
	int __size;	/* sequence of elements <-any> */
	char **__any;
	char *__anyAttribute;	/* optional attribute of type xsd:anyType */
};

struct SOAP_ENV__Header
{
public:
	char *wsa5__MessageID;	/* optional element of type wsa5:MessageID */
	struct wsa5__RelatesToType *wsa5__RelatesTo;	/* optional element of type wsa5:RelatesTo */
	struct wsa5__EndpointReferenceType *wsa5__From;	/* optional element of type wsa5:From */
	struct wsa5__EndpointReferenceType *wsa5__ReplyTo;	/* mustUnderstand */
	struct wsa5__EndpointReferenceType *wsa5__FaultTo;	/* mustUnderstand */
	char *wsa5__To;	/* mustUnderstand */
	char *wsa5__Action;	/* mustUnderstand */
};

9. 有时候执行过程中,可能会有异常,主要是不正确的SOAP header引起的,可以简单处理一下:



DeviceMgmt-service工程:
DeviceMgmt-service\Device


其他service和DeviceMgmt-service工程类似
例子代码中还有一个测试工程“ONVIFServiceTest”,方便大家,很简单
另外由于时间有限,整个VS2010 solution第一次编译可能不通过,大家再编译一次就好了

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值