SOAP is a simple XML-based protocol to let applications exchange information over HTTP.
# SOAP is a protocol for accessing a Web Service.
# SOAP stands for Simple Object Access Protocol
# SOAP is a communication protocol
# SOAP is for communication between applications
# SOAP is a format for sending messages
A SOAP message is an ordinary XML document containing the following elements:
* An Envelope element -identifies the XML document as a SOAP message
* A Header element that contains header information
* A Body element that contains call and response information
* A Fault element containing errors and status information
A SOAP HHTP Web Service Request:
POST /item HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 Content-Length: 250 <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body> <m:GetPrice xmlns:m="http://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> </soap:Envelope>
A SOAP Response
<soap:Body> <m:GetPriceResponse xmlns:m="http://URL/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse> </soap:Body> </soap:Envelope>
SOAP Fault Element
If a Fault element is present, it must appear as a child element of the Body element.
A Fault element can only appear once in a SOAP message.
Sub Element Description
A code for identifying the fault
A human readable explanation of the fault
Information about who caused the fault to happen
Holds application specific error information related to the Body element
VersionMismatch Found an invalid namespace for the SOAP Envelope element
MustUnderstand An immediate child element of the Header element, with the
mustUnderstand attribute set to “1”, was not understood
Client The message was incorrectly formed or contained incorrect information
Server There was a problem with the server so the message could not proceed