Use of onvif gsoap Tool

Source: Internet
Author: User
Tags wsdl

Gsoap generationCode

Onvif compilation (win32)

Compile header files

Wsdl2h.exe-O onvif. H-C-s-t./typemap. dat

Http://www.onvif.org/onvif/ver10/network/wsdl/remotediscovery.wsdl...

Compile C files

Soapcpp2.exe-C-X-I ../; ../import; ../custom onvif. h

 

Required file

(File generation) soapclient. c soapc. c soaph. h soapstub. h

(Gsoap file) stdsoap2.c stdsoap2.h custom/duration. c custom/duratio. h

Modify namespace. C (implemented through nsmap)

 

The following are the options for wsdl2h:

    • -O file name, specifying the output header file
    • -N Space prefixes Replace the default NS
    • -C: generate pure C code; otherwise, it is C ++ code.
    • -S: Do not use STL code
    • -T file name, specifying the type map file. The default value is typemap. dat.
    • -E: Do not add a namespace prefix to an Enum member.

The type map file is used to specify the conversion rules between types in soap/XML and C/C ++. For example

XSD _ string = | STD: wstring | wchar_t *

Then, the string in soap/XML will be converted to STD: wstring or wchar_t * to better support Chinese characters.

Next we will talk about generating the. cpp file in the. h file.

 

The options for soapcpp2.exe are as follows:

    • -C: only generate client code
    • -S: only generate server code
    • -L do not generate soapclientlib. C and soapserverlib. c files
    • -C generates pure C code; otherwise, it is C ++ code (related to header files)
    • -I specifies impORT path (see the preceding Section)
    • -X: do not generate xml sample files.
    • -I generates C ++ packaging. The client is xxxxproxy. H (. cpp), and the server side is xxxxservice. H (. cpp ).

Here, we usually need to include-X, or a lot of XML files will be generated.

-I option must be included, otherwise soapxxxxbindingservice. cpp and soapxxxxbindingservice. H files will not be generated.

-I options must also be included.-I is followed by the import directory in the gsoap path.

Generally-I E: \ workspace \ onvif \ gsoap-2.8 \ gsoap \ import; E: \ workspace \ onvif \ gsoap-2.8 \ gsoap

For example: soapcpp2.exe-X-I-s media. H-I E: \ workspace \ onvif \ gsoap-2.8 \ gsoap \ import; E: \ workspace \ onvif \ gsoap-2.8 \ gsoap

 

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.