• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            面對現(xiàn)實,超越自己
            逆水行舟,不進則退
            posts - 269,comments - 32,trackbacks - 0

            1.介紹

             

                gSOAP編譯工具提供了一個SOAP/XML 關(guān)于C/C++ 語言的實現(xiàn),從而讓C/C++語言開發(fā)web服務(wù)或客戶端程序的工作變得輕松了很多。絕大多數(shù)的C++web服務(wù)工具包提供一組API函數(shù)類庫來處理特定的SOAP數(shù)據(jù)結(jié)構(gòu),這樣就使得用戶必須改變程序結(jié)構(gòu)來適應(yīng)相關(guān)的類庫。與之相反,gSOAP利用編譯器技術(shù)提供了一組透明化的SOAP API,并將與開發(fā)無關(guān)的SOAP實現(xiàn)細(xì)節(jié)相關(guān)的內(nèi)容對用戶隱藏起來。gSOAP的編譯器能夠自動的將用戶定義的本地化的C或C++數(shù)據(jù)類型轉(zhuǎn)變?yōu)榉蟈ML語法的數(shù)據(jù)結(jié)構(gòu),反之亦然。這樣,只用一組簡單的API就將用戶從SOAP細(xì)節(jié)實現(xiàn)工作中解脫了出來,可以專注與應(yīng)用程序邏輯的實現(xiàn)工作了。gSOAP編譯器可以集成C/C++和Fortran代碼(通過一個Fortran到C的接口),嵌入式系統(tǒng),其他SOAP程序提供的實時軟件的資源和信息;可以跨越多個操作系統(tǒng),語言環(huán)境以及在防火墻后的不同組織。

             

                gSOAP使編寫web服務(wù)的工作最小化了。gSOAP編譯器生成SOAP的代碼來序列化或反序列化C/C++的數(shù)據(jù)結(jié)構(gòu)。gSOAP包含一個WSDL生成器,用它來為你的web服務(wù)生成web服務(wù)的解釋。gSOAP的解釋器及導(dǎo)入器可以使用戶不需要分析web服務(wù)的細(xì)節(jié)就可以實現(xiàn)一個客戶端或服務(wù)端程序。下面是gSOAP的一些特點:

             

            l        gSOAP編譯器可以根據(jù)用戶定義的C和C++數(shù)據(jù)結(jié)構(gòu)自動生成符合SOAP的實例化代碼。

            l        gSOAP支持WSDL 1.1, SOAP 1.1, SOAP 1.2, SOAP RPC 編碼方式以及 literal/document 方式.

            l        gSOAP是少數(shù)完全支持SOAP1.1 RPC編碼功能的工具包,包括多維數(shù)組及動態(tài)類型。比如,一個包含一個基類參數(shù)的遠(yuǎn)程方法可以接收客戶端傳來的子類實例。子類實例通過動態(tài)綁定技術(shù)來保持一致性。

            l        gSOAP 支持 MIME (SwA) 和 DIME 附件包。

            l        gSOAP是唯一支持DIME附件傳輸?shù)墓ぞ甙K试S你在保證XML可用性的同時能夠以最快的方式(流方式)傳遞近乎無大小限制的二進制數(shù)據(jù)。

            l        gSOAP 支持 SOAP-over-UDP。

            l        gSOAP 支持 IPv4 and IPv6.

            l        gSOAP 支持 Zlib deflate and gzip compression (for HTTP, TCP/IP, and XML file storage)。

            l        gSOAP 支持 SSL (HTTPS)。

            l        gSOAP 支持 HTTP/1.0, HTTP/1.1 保持連接, 分塊傳輸及基本驗證。

            l        gSOAP 支持 SOAP 單向消息。

            l        gSOAP 包含一個 WSDL 生成器,便于web服務(wù)的發(fā)布。

            l        gSOAP 包含一個WSDL解析器 (將WSDL轉(zhuǎn)換為gSOAP頭文件),可以自動化用戶客戶端及服務(wù)端的開發(fā)。

            l        生成可以單獨運行的web服務(wù)及客戶端程序。

            l        因為只需要很少內(nèi)存空間,所以可以運行在類似Palm OS, Symbian, Pocket PC的小型設(shè)備中。

            l        適用于以C或C++開發(fā)的web服務(wù)中。

            l        跨平臺:Windows, Unix, Linux, Mac OS X, Pocket PC, Palm OS, Symbian等。

            l        支持序列化程序中的本地化C/C++數(shù)據(jù)結(jié)構(gòu)。

            l        可以使用輸入和輸出緩沖區(qū)來提高效率,但是不用完全消息緩沖來確定HTTP消息的長度。取而代之的是一個三相序列化方法。這樣,像64位編碼的圖像就可以在小內(nèi)存設(shè)備(如PDA)中以DIME附件或其他方式傳輸。

            l        支持C++單繼承,動態(tài)綁定,重載,指針結(jié)構(gòu)(列表、樹、圖、循環(huán)圖,定長數(shù)組,動態(tài)數(shù)組,枚舉,64位2進制編碼及16進制編碼)。

            l        不需要重寫現(xiàn)有的C/C++應(yīng)用。但是,不能用unions,指針和空指針來作為遠(yuǎn)程方法調(diào)用參數(shù)的數(shù)據(jù)結(jié)構(gòu)中元素。

            l        三相編組:1)分析指針,引用,循環(huán)數(shù)據(jù)結(jié)構(gòu);2)確定HTTP消息長度;3)將數(shù)據(jù)序列化位SOAP1.1編碼方式或用戶定義的數(shù)據(jù)編碼方式。

            l        雙相編組:1)SOAP解釋及編碼;2)分解“forward”指針(例如:分解SOAP中的href屬性)。

            l        完整可定制的SOAP錯誤處理機制。

            l        可定制的SOAP消息頭處理機制,可以用來保持狀態(tài)信息

            gsoap通常帶有兩個工具: wsdl2h 和 soapcpp2。 wsdl2h主要是用來生成頭文件的,而soapcpp2主要是利用wsdl2h生成的頭文件來生成C文件或C++文件。 

            以下是README.txt中示例:

            Example translation of WSDL to code in two steps:
            $ wsdl2h -s -o calc.h http://www.cs.fsu.edu/~engelen/calc.wsdl
            $ soapcpp2 calc.h

            Windows下命令行運行:

                   wsdl2h.exe -o TestServices.h http://192.168.20.242/ClientUpdateWebService.asmx?WSDL
                   soapcpp2 TestServices.h 


            出現(xiàn)如下錯誤:Critical error: #import: Cannot open file "stlvector.h" for reading.你需要在gsoap\import下把這個文件拷貝過來。

             wsdl2h
            **  The gSOAP WSDL/Schema processor for C and C++, wsdl2h release 2.8.5
            **  Copyright (C) 2000-2011 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.w
            sdl 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) 
            soapcpp2
            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)          
            其他相關(guān)鏈接: http://www.shnenglu.com/woaidongmao/archive/2008/05/28/51400.html
            posted on 2012-11-16 17:14 王海光 閱讀(3028) 評論(0)  編輯 收藏 引用 所屬分類: 工具
            中文字幕乱码久久午夜| 品成人欧美大片久久国产欧美... 品成人欧美大片久久国产欧美 | 亚洲人成无码www久久久| 亚洲国产成人久久综合区| 久久久无码精品亚洲日韩蜜臀浪潮| 久久99久国产麻精品66| 久久夜色精品国产亚洲| 欧美亚洲日本久久精品| 精品久久8x国产免费观看| 久久精品成人| 精品999久久久久久中文字幕| 天天综合久久一二三区| 久久精品国产亚洲AV无码麻豆 | 国产精品成人99久久久久| 色诱久久av| 91精品国产91热久久久久福利 | 日韩亚洲国产综合久久久| 国产精品女同久久久久电影院| 亚洲国产成人精品91久久久 | 99久久婷婷免费国产综合精品| 国産精品久久久久久久| 久久精品国产亚洲AV麻豆网站| 亚洲精品无码久久毛片| 国产精品欧美久久久久无广告| 久久综合香蕉国产蜜臀AV| 久久乐国产综合亚洲精品| 久久精品一区二区三区中文字幕| 久久久久99精品成人片试看| 久久精品中文字幕一区| 久久精品亚洲乱码伦伦中文| 很黄很污的网站久久mimi色| 亚洲狠狠综合久久| 久久精品国产亚洲网站| 91精品国产高清久久久久久io| 久久无码人妻一区二区三区午夜 | 久久久久国产亚洲AV麻豆| 青青青国产精品国产精品久久久久| 亚洲国产欧洲综合997久久| 日韩欧美亚洲综合久久 | 色老头网站久久网| 久久精品免费全国观看国产|