兩個SOAP封裝例子
作者:佚名
這里我們針對SOAP封裝的內(nèi)容,列舉了兩個代碼例子。那么通過下面的兩則例子,希望大家能夠得到一些有價值的參考。
對于SOAP協(xié)議的內(nèi)容,我們在前面的文章中已經(jīng)講解過了它的基礎內(nèi)容。這里我們主要針對SOAP封裝進行一下案例的分析。那么下邊我們主要舉出了兩個SOAP封裝的例子,給大家提供一個參考。
SOAP封裝:請求編碼舉例
SOAP封裝例1
- POST /StockQuote HTTP/1.1
- Host: www.stockquoteserver.com
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- SOAPAction: "Some-URI"
- <SOAP-ENV:Envelope
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <SOAP-ENV:Header>
- <t:Transaction
- xmlns:t="some-URI"
- SOAP-ENV:mustUnderstand="1">
- 5
- </t:Transaction>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <m:GetLastTradePrice xmlns:m="Some-URI">
- <symbol>DEF</symbol>
- </m:GetLastTradePrice>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
SOAP封裝例2
- POST /StockQuote HTTP/1.1
- Host: www.stockquoteserver.com
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- SOAPAction: "Some-URI"
- <SOAP-ENV:Envelope
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <SOAP-ENV:Body>
- <m:GetLastTradePriceDetailed
- xmlns:m="Some-URI">
- <Symbol>DEF</Symbol>
- <Company>DEF Corp</Company>
- <Price>34.1</Price>
- </m:GetLastTradePriceDetailed>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
責任編輯:佟健
來源:
hi.baidu.com