Search notes:

Simple Object Access Protocol

SOAP is a messaging protocol specification for exchanging structured information. The protocol was originally developed by Microsoft.
The message format is exclusively based XML.
The underlying protocol is most likely HTTP (It also operates over SMTP, TCP, UDP, JMS etc). HTTP is preferred because it easily tunnels through firewalls and proxies.
SOAP, WSDL and UDDI (Universal Description, Discovery, and Integration) can be seen as the three pillars of web services.

Structure of a message

The envelope and the body are required, header and fault are not.

Major characteristics

Concepts

Encapsulation

Example message

HTTP request

POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
SOAPAction: "http://www.w3.org/2003/05/soap-envelope"

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:m="http://www.example.org/stock/Reddy">
  <soap:Header>
  </soap:Header>
  <soap:Body>
    <m:GetStockPrice>
      <m:StockName>GOOG</m:StockName>
    </m:GetStockPrice>
  </soap:Body>
</soap:Envelope>

HTTP response

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/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">

<soap:Body xmlns:m="http://www.example.org/stock">
  <m:GetStockPriceResponse>
    <m:Price>34.5</m:Price>
  </m:GetStockPriceResponse>
</soap:Body>

</soap:Envelope>

TODO

WS-Addressing

See also

SOAP vs REST
WSDL provides a definition how the web service works.
web service

Index