gsoap onvif 离线生成文件

gsoap 开源的版本是不支持https的请求,最近我发再onvif官网的wdsl资源全部都使用了https,所以我得让它离线或者自己搭建服务

 

下面我们开始做自己的服务,因为我感觉做成服务会比离线好点

首先我们把需要的wsdl下载回来

http://www.onvif.org/onvif/ver10/network/wsdl/remotediscovery.wsdl  
http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl  
http://www.onvif.org/onvif/ver10/events/wsdl/event.wsdl 
http://www.onvif.org/onvif/ver10/display.wsdl 
http://www.onvif.org/onvif/ver10/deviceio.wsdl  
http://www.onvif.org/onvif/ver20/imaging/wsdl/imaging.wsdl 
http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl  
http://www.onvif.org/onvif/ver20/media/wsdl/media.wsdl  
http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl  
http://www.onvif.org/onvif/ver10/receiver.wsdl  
http://www.onvif.org/onvif/ver10/recording.wsdl 
http://www.onvif.org/onvif/ver10/search.wsdl  
http://www.onvif.org/onvif/ver10/replay.wsdl  
http://www.onvif.org/onvif/ver20/analytics/wsdl/analytics.wsdl    
http://www.onvif.org/onvif/ver10/analyticsdevice.wsdl 
http://www.onvif.org/onvif/ver10/schema/onvif.xsd  
http://www.onvif.org/ver10/actionengine.wsdl  
http://www.onvif.org/ver10/pacs/accesscontrol.wsdl  
http://www.onvif.org/ver10/pacs/doorcontrol.wsdl  
http://www.onvif.org/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl  
http://www.onvif.org/ver10/accessrules/wsdl/accessrules.wsdl  
http://www.onvif.org/ver10/credential/wsdl/credential.wsdl  
http://www.onvif.org/ver10/schedule/wsdl/schedule.wsdl 
http://www.onvif.org/ver10/pacs/types.xsd

 

然后使用nginx把它们发布出来

为了方便大家,我已经把一些放到csdn上

https://download.csdn.net/download/qq_35978045/12054851

使用 

 只需要把域名改为本地的就可以了

.\wsdl2h.exe  -o .\onvif_head\onvif.h  -t .\typemap.dat  http://127.0.0.1:8083/ver10/network/wsdl/remotediscovery.wsdl http://127.0.0.1:8083/ver10/device/wsdl/devicemgmt.wsdl http://127.0.0.1:8083/ver10/events/wsdl/event.wsdl http://127.0.0.1:8083/ver10/display.wsdl http://127.0.0.1:8083/ver10/deviceio.wsdl  http://127.0.0.1:8083/ver20/imaging/wsdl/imaging.wsdl http://127.0.0.1:8083/ver10/media/wsdl/media.wsdl  http://127.0.0.1:8083/ver20/media/wsdl/media.wsdl  http://127.0.0.1:8083/ver20/ptz/wsdl/ptz.wsdl  http://127.0.0.1:8083/ver10/receiver.wsdl http://127.0.0.1:8083/ver10/recording.wsdl http://127.0.0.1:8083/ver10/search.wsdl  http://127.0.0.1:8083/ver10/replay.wsdl  http://127.0.0.1:8083/ver20/analytics/wsdl/analytics.wsdl   http://127.0.0.1:8083/ver10/analyticsdevice.wsdl http://127.0.0.1:8083/ver10/schema/onvif.xsd http://127.0.0.1:8083/ver10/actionengine.wsdl http://127.0.0.1:8083/ver10/pacs/accesscontrol.wsdl   http://127.0.0.1:8083/ver10/pacs/doorcontrol.wsdl   http://127.0.0.1:8083/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl   http://127.0.0.1:8083/ver10/accessrules/wsdl/accessrules.wsdl   http://127.0.0.1:8083/ver10/credential/wsdl/credential.wsdl   http://127.0.0.1:8083/ver10/schedule/wsdl/schedule.wsdl  http://127.0.0.1:8083/ver10/pacs/types.xsd 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
使用gSOAP生成ONVIF框架代码需要遵循以下步骤: 1. 下载gSOAP工具包并安装到本地。 2. 下载ONVIF设备WSDL文件,例如https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl。 3. 使用gSOAP工具包中的wsdl2h工具将WSDL文件转换为头文件。 4. 使用soapcpp2工具生成ONVIF框架代码,例如: ```bash soapcpp2 -Iimport devicemgmt.h ``` 5. 在生成的代码中实现ONVIF设备的具体操作。 以下是在Linux系统中使用gSOAP生成ONVIF框架代码的示例: 1. 下载gSOAP工具包并安装到本地: ```bash wget https://sourceforge.net/projects/gsoap2/files/gSOAP/gsoap_2.8.112.zip unzip gsoap_2.8.112.zip cd gsoap-2.8 ./configure make sudo make install ``` 2. 下载ONVIF设备WSDL文件: ```bash wget https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl ``` 3. 使用wsdl2h工具将WSDL文件转换为头文件: ```bash wsdl2h -o onvif.h devicemgmt.wsdl ``` 4. 使用soapcpp2工具生成ONVIF框架代码: ```bash soapcpp2 -Iimport onvif.h ``` 5. 在生成的代码中实现ONVIF设备的具体操作。 在生成的代码中,每个ONVIF操作都有对应的函数,例如`SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDeviceInformation(struct soap* soap, _tds__GetDeviceInformation* tds__GetDeviceInformation, _tds__GetDeviceInformationResponse &tds__GetDeviceInformationResponse)`就是获取设备信息的函数。您可以在这些函数中实现具体的操作。 另外,生成的代码中还有一些辅助函数和结构体,您也可以根据需要使用它们。 例如,以下代码片段演示了如何创建一个SOAP客户端并调用`__tds__GetDeviceInformation`函数: ```c++ #include "soapDeviceBindingProxy.h" const char* endpoint = "http://192.168.1.100/onvif/device_service"; DeviceBindingProxy proxy; proxy.soap_endpoint = endpoint; _tds__GetDeviceInformation tds__GetDeviceInformation; _tds__GetDeviceInformationResponse tds__GetDeviceInformationResponse; proxy.__tds__GetDeviceInformation(&tds__GetDeviceInformation, tds__GetDeviceInformationResponse); // 处理返回值 ``` 在使用时,需要将`endpoint`替换为实际的设备IP地址和ONVIF服务端口号。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值