gsoap_2.8.8與2.8.17 編譯生成onvif框架

cmd: wsdl2h -h           [ show the help ]
**  The gSOAP WSDL/Schema processor for C and C++, wsdl2h release 2.8.8
**  Copyright (C) 2000-2012 Robert van Engelen, Genivia Inc.
**  All Rights Reserved. This product is provided "as is", without any warranty.
**  The wsdl2h tool is released under one of the following two licenses:
**  GPL or the commercial license by Genivia Inc. Use option -l for details.

Usage: wsdl2h [-a] [-c] [-d] [-e] [-f] [-g] [-h] [-I path] [-i] [-j] [-k] [-l] [-m] [-n name] [-N name] [-p|-P] [-q name] [-r proxyhost[:port[:uid:pwd]]] [-s] [
-t typemapfile] [-u] [-v] [-w] [-W] [-x] [-y] [-z#] [-_] [-o outfile.h] infile.wsdl infile.xsd http://www... ...

-a      generate indexed struct names for local elements with anonymous types
-c      generate C source code
-d      use DOM to populate xs:any, xs:anyType, and xs:anyAttribute
-e      don't qualify enum names
-f      generate flat C++ class hierarchy
-g      generate global top-level element declarations
-h      display help info
-i      don't import (advanced option)
-Ipath  use path to find files
-j      don't generate SOAP_ENV__Header and SOAP_ENV__Detail definitions
-k      don't generate SOAP_ENV__Header mustUnderstand qualifiers
-l      display license information
-m      use xsd.h module to import primitive types
-nname  use name as the base namespace prefix instead of 'ns'
-Nname  use name as the base namespace prefix for service namespaces
-ofile  output to file
-p      create polymorphic types with C++ inheritance from base xsd__anyType
-P      don't create polymorphic types with C++ inheritance from xsd__anyType
-qname  use name for the C++ namespace of all declarations
-rhost[:port[:uid:pwd]]
        connect via proxy host, port, and proxy credentials
-s      don't generate STL code (no std::string and no std::vector)
-tfile  use type map file instead of the default file typemap.dat
-u      don't generate unions
-v      verbose output
-w      always wrap response parameters in a response struct (<=1.1.4 behavior)
-W      suppress warnings
-x      don't generate _XML any/anyAttribute extensibility elements
-y      generate typedef synonyms for structs and enums
-z1     compatibility with 2.7.6e: generate pointer-based arrays
-z2     compatibility with 2.7.15: qualify element/attribute referenced members
-_      don't generate _USCORE (replace with UNICODE _x005f)
infile.wsdl infile.xsd http://www... list of input sources (if none: use stdin)


cmd: soapcpp2 -h           [ show the help ]
Usage: soapcpp2 [-1|-2] [-C|-S] [-T] [-L] [-a] [-b] [-c] [-d path] [-e] [-f N] [-h] [-i] [-I path;path;...] [-k] [-l] [-m] [-n] [-p name] [-s] [-t] [-u] [-v] [-
w] [-x] [-y] [infile]

-1      generate SOAP 1.1 bindings
-2      generate SOAP 1.2 bindings
-C      generate client-side code only
-S      generate server-side code only
-T      generate server auto-test code
-L      don't generate soapClientLib/soapServerLib
-a      use SOAPAction HTTP/WSA header to invoke server-side operations
-b      serialize byte arrays char[N] as string
-c      generate C source code
-dpath  use path to save files
-e      generate SOAP RPC encoding style bindings
-fN     file split of N XML serializer implementations per file (N>=10)
-h      display help info
-Ipath  use path(s) for #import
-i      generate C++ service proxies and objects inherited from soap struct
-j      generate C++ service proxies and objects that share a soap struct
-k      generate data structure walkers (experimental)
-l      generate linkable modules (experimental)
-m      generate Matlab(tm) code for MEX compiler
-n      use service name to rename service functions and namespace table
-pname  save files with new prefix name instead of 'soap'
-qname  use name as the C++ namespace of all declarations
-s      generate deserialization code with strict XML validation checks
-t      generate code for fully xsi:type typed SOAP/XML messaging
-u      uncomment comments in WSDL/schema output by suppressing XML comments
-v      display version info
-w      don't generate WSDL and schema files
-x      don't generate sample XML message files
-y      include C/C++ type access information in sample XML messages
infile  header file to parse (or stdin)


1.gSoap開發包的下載地址http://sourceforge.net/projects/gsoap2

2.wsdl下載地址:http://www.onvif.org/Documents/Specifications.aspx  [下載成xml文件基本可以, 好像沒差別,對比了一下]

3.[需要拷貝到compile目錄中  ] 修改typemap.dat,h在FAQ頁面下的How do I use gSOAP for the ONVIF specifications? [ http://www.cs.fsu.edu/~engelen/soap.html  ] 
typemap.dat位於gsoap_2.8.8\gsoap-2.8\gsoap

4. 鏈接網絡生成方法的優點是不用考慮以上文件對其它文件的依賴關係,不用修改引入路徑。
該方法的缺點跟網速有關,因此中途可能會中斷,如果超過5分鐘未生成,可重新執行命令, 通過代理上網則無法生成,不推薦用此方法。
各url之間用空格隔開. 
wsdl2h  -s -t ./typemap.dat -o onvif.h 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/ver20/analytics/wsdl/analytics.wsdl http://www.onvif.org/onvif/ver10/analyticsdevice.wsdl http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl http://www.onvif.org/onvif/ver10/deviceio.wsdl http://www.onvif.org/onvif/ver10/display.wsdl http://www.onvif.org/onvif/ver10/event/wsdl/event.wsdl http://www.onvif.org/onvif/ver20/imaging/wsdl/imaging.wsdl http://www.onvif.org/onvif/ver10/recording.wsdl http://www.onvif.org/onvif/ver10/replay.wsdl  http://www.onvif.org/onvif/ver10/search.wsdl  http://www.onvif.org/onvif/ver10/receiver.wsdl  http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl

5.本地compile [ 需要修改部分文件路徑 ]
wsdl2h.exe -o onvif.h -s -t ./typemap.dat remotediscovery.xml devicemgmt.xml event.xml media.xml analytics.xml deviceio.xml imaging.xml ptz.xml

6.create the onvif source code
soapcpp2.exe -2 onvif.h -C -x -L -i -d ./src -I ./import;./custom

[ soapcpp2.exe位於gsoap_2.8.8\gsoap-2.8\gsoap\bin ]
[ import位於gsoap_2.8.8\gsoap-2.8\gsoap ]
[ custom位於gsoap_2.8.8\gsoap-2.8\gsoap ] 需要拷貝到當前目錄中   
2.8.17 compile will be [ "1 semantic error" ]:wsa5.h(288): **ERROR**: remote method name clash: struct/class 'SOAP_ENV__Fault' already declared at line 274
wsa5.h 文件中註釋掉即可, 有無影響待確認


7.



source files:
http://blog.csdn.net/zsl461975543/article/details/8971143
http://m.blog.csdn.net/blog/woaiguzi/9133215
http://wenku.baidu.com/link?url=PrUXhGuHWGqAAqYmNEqMmwb0BGYOKckSduKXJm8pnSJpCDG4AJxqWYxV6nnncv5GAGYQ8sePTsWDYIeA49H7HsyeTZvZJOKLwePAfjDN8le
http://blog.chinaunix.net/uid-20682890-id-4057549.html
http://blog.csdn.net/stelalala/article/details/9182443
http://blog.csdn.net/darkone/article/details/1442525
http://www.fqyy.org/sunu/archives/1015.html
http://blog.csdn.net/stelalala/article/details/9182443
http://www.cs.fsu.edu/~engelen/soap.html
http://blog.csdn.net/ghostyu/article/details/8182516
http://blog.csdn.net/zhuzhihai1988/article/details/8131370
http://www.360doc.com/content/14/0808/10/9075092_400282762.shtml
http://blog.csdn.net/butyesbutno/article/details/8608059
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章