ONVIF Learning-ONVIF Development Framework Building (C + +)

Source: Internet
Author: User
Tags wsdl

The first step, download gSOAP

Download the latest version of gSOAP from the gSOAP official website (http://www.genivia.com/products.html#notice) (gsoap_2.8.45 for bloggers). There are three versions of gSOAP: Open Source gsoap, commercial gsoap Edition, commercial gSOAP Edition. We can download the open source version.

Step two, unzip the gSOAP and create a folder hierarchy

Create a new folder, named Onvifframework, to extract the downloaded Gsoap_x.x.xx.zip to the folder. Under this folder, create a new two folder named: Level1 and Ver10. Create a new folder under the Level1 folder named: Level2. Under the Level2 folder, create a new three folder named: Frameworksource, Generatesource, Ver10. Create three folders under the Ver10 folder named: Device, media, schema. Create a new folder under the device and Media folder, named WSDL. Create a new folder under the Ver10 folder, named Schema. The folder must be established in this order. Finally, the Typemap.dat and onvifframework\gsoap-2.8\gsoap\bin\win32 paths under the Onvifframework\gsoap-2.8\gsoap path are Wsdl2h.exe, Soapcpp2.exe (WSDL2H does not support HTTPS and needs to recompile gSOAP, the compilation method references the bottom blog link) to the Generatesource folder.

The specific folder hierarchy looks like this:

Step three, download onvif related documents

Onvif WSDL and XML Schemas from Onvif official website (http://www.onvif.org/Documents/Specifications.aspx) The specifications page Downloads the WSDL (right-click to save the link) and places the downloaded WSDL inside the Generatesource folder. Copy devicemgmt.wsdl to D:\ONVIF\OnvifFramework\level1\level2\ver10\device\wsdl path, copy media.wsdl to Onvifframework\ Under the LEVEL1\LEVEL2\VER10\MEDIA\WSDL path, copy the onvif.xsd to the Onvifframework\level1\level2\ver10\schema path, Copy the onvif.xsd to the Onvifframework\ver10\schema path.

Fourth step, Generate Onvif.h

generation is divided into online generation and local generation of two, in view of the instability of online generation, bloggers use the local generation method. Open the console, switch to the Generatesource path, and enter Wsdl2h-o onvif.h-t in the console./typemap.dat accesscontrol.wsdl accessrules.wsdl ACTIONENGINE.WSDL advancedsecurity.wsdl analytics.wsdl analyticsdevice.wsdl

CREDENTIAL.WSDL deviceio.wsdl devicemgmt.wsdl display.wsdl doorcontrol.wsdl event.wsdl imaging.wsdl media.wsdl PTZ.WSDL receiver.wsdl recording.wsdl remotediscovery.wsdl replay.wsdl schedule.wsdl search.wsdl

(separated by a space between each WSDL)

Fifth step, generate the source code framework from the Onvif.h file

If authentication is required, modify the Onvif.h header file and add the #import "Wsse.h". Comment out or change the soap_env__fault structure in wsa5.h under the Onvifframework\gsoap-2.8\gsoap\import path to another name, such as Soap_env__fault_alex. When you are finished modifying, enter Soapcpp2-j onvif.h-i in the console. /.. /.. /gsoap-2.8/gsoap/import:.. /.. /.. /gsoap-2.8/gsoap, see compilation successful is the success.

Sixth step, organize the source code

Copy the generated. h and. cpp files and the Wsdd.nsmap file to Frameworksource, and copy the onvifframework\gsoap-2.8\ gSOAP the path under Stdsoap2.h and Stdsoap2.cpp to the folder.

Summarize

through the above six steps to complete the ONVIF development framework, the future development of ONVIF applications, the direct copy of the Frameworksource folder files can be (development onvif client program, Using XXXXProxy.h and XXXXProxy.cpp, develop ONVIF server-side programs, using XXXXService.h and XXXXService.cpp). Onvif The framework file has been uploaded, please download it here (http://download.csdn.net/download/u011110151/9898860).

This blog (http://blog.csdn.net/saloon_yuan/article/details/24901597) and this blog (http://blog.csdn.net/benkaoya/article/ details/72466827) is a great help to the bloggers, thank you very much.

ONVIF Learning-ONVIF Development Framework Building (C + +)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.