SOAP Notes

  1. Introduction
    SOAP Stands for Simple Object Access Protocol.
    SOAP is a communication protocol.
    SOAP is for communcation between applications.
    SOAP is a format for sending messages.
    SOAP is designed to communicate via the internet.
    SOAP is platform independent.
    SOAP is language independent.
    SOAP is based on XML.
    SOAP is simple and extensible.
    SOAP allows you to get around firewalls.
    SOAP will be developed as a W3C standard.
    SOAP is a key element of Microsoft's .NET architecture.
  2. Syntax
    A SOAP message is an ordinary XML document containing the following elements.
    A required envelope element that identifies the XML document as a SOAP message.
    An optional header element that contains header information.
    A required body element that contains call and response information.
    An optional fault element that provides error information that occurs while processing the message.
    All the elements above are declared in the default namespace for the SOAP envelope.
  3. SOAP Envelope
    The mandatory SOAP envelop element is the root element of a SOAP message.
  4. SOAP Header
  5. SOAP Body
  6. SOAP Fault
  7. SOAP HTTP Binding
  8. SOAP Example
    In the example below, a GetStockPrice request is sent to a server. The requst has a StockName parameter, and a Price parameter will be returned in the response.The namespace for the function is defined in http://www.stock.org/stock* address.
              POST /InStock HTTP/1.1
              Host: www.stock.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.stock.org/stock">
                  <m:GetStockPrice>
                    <m:StockName>IBM</m:StockName>
                  </m:GetStockPrice>
                </soap:Body>
    
              </soap:Envelope>
            
    A SOAP response:
              HTTP/1.1 200 OK
              Content-Type: application/soap; 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.stock.org/stock">
                  <m:GetStockPriceResponse>
                    <m:Price>34.5</m:Price>
                  </m:GetStockPriceResponse>
                </soap:Body>
    
              </soap:Envelope>
            
Hosted by www.Geocities.ws

1