I would love nothing better than to explain the virtues of Lever 2000 (Original), or discuss the 1970's sitcom, but alas, this rant will be about the computer version of SOAP.

2SOAPS.jpg

What is SOAP?

From Wikipedia, "SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on Extensible Markup Language (XML) for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission."

 

In English

SOAP is something used so that multiple computers can talk to one another and exchange information.

 

What are SOAP's characteristics?

From Wikipedia, "SOAP can form the foundation layer of a web services protocol stack, providing a basic messaging framework upon which web services can be built. This XML based protocol consists of three parts: an envelope, which defines what is in the message and how to process it, a set of encoding rules for expressing instances of application-defined datatypes, and a convention for representing procedure calls and responses. SOAP has three major characteristics: Extensibility (security and WS-routing are among the extensions under development), Neutrality (SOAP can be used over any transport protocol such as HTTP, SMTP, TCP, or JMS) and Independence (SOAP allows for any programming model). As an example of how SOAP procedures can be used, a SOAP message could be sent to a web site that has web services enabled, such as a real-estate price database, with the parameters needed for a search. The site would then return an XML-formatted document with the resulting data, e.g., prices, location, features. With the data being returned in a standardized machine-parsable format, it can then be integrated directly into a third-party web site or application."


In English

SOAP is like an HTML-based communication system that delivers and receives messages/instructions.

 

SOAP Example

From Wikipedia:


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">

  <soap:Header>

  </soap:Header>

  <soap:Body>

  <m:GetStockPrice xmlns:m="http://www.example.org/stock">

  <m:StockName>IBM</m:StockName>

  </m:GetStockPrice>

  </soap:Body>

</soap:Envelope>


In English

The following header of the example gives instructions on where to go and how to get there:


POST /InStock HTTP/1.1 - What are we doing and how are we going to get somewhere? (POSTing using HTTP).

Host: www.example.org - Where we're going. (www.example.org).

Content-Type: application/soap+xml; charset=utf-8 - What format will the content be in? (XML).

Content-Length: 299 - How large is the content? 299.

SOAPAction: "http://www.w3.org/2003/05/soap-envelope" - The action SOAP is based on. http://www.w3.org/2003/05/soap-envelope

 


The body. Essentially, this XML snippet is going to a website that provides stock prices and is getting the price of IBM, as shown between the BODY tags.


<?xml version="1.0"?>

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">

  <soap:Header>

  </soap:Header>

  <soap:Body>

  <m:GetStockPrice xmlns:m="http://www.example.org/stock">

  <m:StockName>IBM</m:StockName>

  </m:GetStockPrice>

  </soap:Body>

</soap:Envelope>