Simple Object Access Protocol (SOAP)

 

SOAP is an XML-based protocol used to exchange information in a decentralized, distributed environment. The protocol consists of:

  1. An envelope that contains the body of the message, identifies who should process it, and describes how to process it.

  2. A set of encoding rules for expressing instances of application-specific data types.

  3. A convention for representing remote procedure calls and responses.

This information is embedded in a MIME-encoded package that can be transmitted over HTTP or other Web protocols. MIME is a specification for formatting non-ASCII messages so that they can be sent over the Internet.

The following example shows a SOAP request for stock trading information embedded inside an HTTP request:

POST /StockQuote HTTP/1.1

Host:           www.sample.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:GetLastStockQuote xmlns:m="Some-URI">
               <symbol>BEAS</symbol>
          </m:GetLastStockQuote>

     </SOAP-ENV:Body>

</SOAP-ENV:Envelope>