What is SOAP ?

SOAP stands for Simple Object Access Protocol.

SOAP is a communication protocol that is used for communication between applications.

SOAP communicates over the internet and is both platform and language dependent.

SOAP is a XML – based protocol used by applications to exchange information over HTTP.

A SOAP message is a XML document which contains the following elements

  1. Envelope element
  2. Header element
  3. Body element
  4. Fault element

Envelope element is the required and root element of a SOAP message. This element describes what is in the message and how to process it.

Header element is an optional element which contains application specific information (like authentication, payment etc…) about the SOAP message. If the Header element is present, it must be the first child element of the Envelope element.

Body element is a required element. It contains the actual SOAP message.

Fault element: Whenever an error occurs during processing of a SOAP request, the response is a fault element present in the body of the message.

Example Request

{code type=html}

POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?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 xmlns:m=”http://www.example.org/stock”>
<m:GetMyMailRequest>
<m:Name>Yasser</m:Name>
</m: GetMyMailRequest >
</soap:Body>

</soap:Envelope>

{/code}

Example Response

{code type=html}

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?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 xmlns:m=”http://www.example.org/stock”>
<m: GetMyMailResponse >
<m:EmailId>yrshaikh.mail@gmail.com</m: EmailId >
</m: GetMyMailResponse >
</soap:Body>

</soap:Envelope>

{/code}