We will not repeat some basic concepts of the SOAP protocol here. We have also provided some examples of the content encapsulated by SOAP. Here we will introduce some examples of the SOAP Protocol response encoding.
SOAP Protocol response code example 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 Protocol response encoding Example 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 Protocol response encoding Example 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 Protocol response code example 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>