四個SOAP協(xié)議應(yīng)答編碼例子
作者:佚名
這里我們主要講解了4個SOAP協(xié)議應(yīng)答編碼的例子,希望大家通過下面的例子可以得到一些參考,對于今后的學(xué)習(xí)能夠有一個輔助。
對于SOAP協(xié)議的一些基本概念我們在這里不多贅述了。前面我們也對SOAP封裝的內(nèi)容進行了一些舉例講解,這里我們再來對SOAP協(xié)議應(yīng)答編碼的一些例子盡心改一下介紹。
SOAP協(xié)議應(yīng)答編碼例1
- HTTP/1.1 200 OK
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- <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" xsi:type="xsd:int" mustUnderstand="1"> 5 </t:Transaction>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <m:GetLastTradePriceResponse xmlns:m="Some-URI">
- <Price>34.5</Price>
- </m:GetLastTradePriceResponse>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
SOAP協(xié)議應(yīng)答編碼例2
- HTTP/1.1 200 OK
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- <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:GetLastTradePriceResponse
- xmlns:m="Some-URI">
- <PriceAndVolume>
- <LastTradePrice> 34.5 </LastTradePrice>
- <DayVolume> 10000 </DayVolume>
- </PriceAndVolume>
- </m:GetLastTradePriceResponse>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
SOAP協(xié)議應(yīng)答編碼例3
- HTTP/1.1 500 Internal Server Error
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- <SOAP-ENV:Envelope
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Body>
- <SOAP-ENV:Fault>
- <faultcode>SOAP-ENV:MustUnderstand</faultcode>
- <faultstring>SOAP Must Understand Error</faultstring>
- </SOAP-ENV:Fault>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
SOAP協(xié)議應(yīng)答編碼例4
- HTTP/1.1 500 Internal Server Error
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- <SOAP-ENV:Envelope
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Body>
- <SOAP-ENV:Fault>
- <faultcode>SOAP-ENV:Server</faultcode>
- <faultstring>Server Error</faultstring>
- <detail>
- <e:myfaultdetails xmlns:e="Some-URI">
- <message>
- My application didn't work
- </message>
- <errorcode> 1001 </errorcode>
- </e:myfaultdetails>
- </detail>
- </SOAP-ENV:Fault>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
責(zé)任編輯:佟健
來源:
互聯(lián)網(wǎng)