SOAP in a Nutshell
by Thomas Erl

The Simple Object Access Protocol (SOAP) is a technology based on XML and HTTP that supports and extends interoperability between Web applications by providing a platform and vendor independent method for inter-application communication, specifically, communication between application services. Traditionally this was accomplished through binary communication protocols, such as DCOM, which were originally designed for use in client-server environments.

Until now, one of the primary challenges encountered with integrating these binary protocols within Internet applications has been the requirement that firewalls open a separate port (in addition to the HTTP port) to allow external communication with application services. This raised both operational and security issues. SOAP addresses these concerns by allowing access to application services via HTTP.

Since SOAP is also vendor neutral, it aims to become a universal application services protocol, eliminating the need to choose a vendor-specific platform. This opens up many new interoperability opportunities which previously required "bridging" and "gateway" technologies. For instance, with SOAP as the chosen communications protocol, COM components can communicate directly with CORBA components.

It is worth noting, however, that the current SOAP specification does not provide some of the advanced features of binary communication technologies, such as automatic garbage collection, and the ability to group messages in batches.

As with standard inter-component communication, a message requesting the use of a service (component) must identify the service, method and parameters. A SOAP request message defines the target service in its header section (which is similar to standard HTTP header syntax), as follows:

POST /CheckBooks HTTP/1.1
Host: www.bookwarehouse.com
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
SOAPAction: www.soasystems.com

The details of the service communication are established in the body of the SOAP message, known as the "envelope", using XML syntax as follows:

<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:CheckAvailability xmlns:m="www.soasystems.com">
      <title>
         Lathering for Dummies
      </title>
     </m:CheckAvailability>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

While SOAP messages can be transmitted just one way, a complete request/response model (called the "Message Exchange Model") is provided allowing components to return results in response to a request.

The headers of a typical (successful) SOAP response message would appear similar to the following:

HTTP/1.1 200 OK
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn

The following envelope section of the SOAP response provides a return value:

<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:CheckAvailabilityResponse xmlns:m="www.soasystems.com">
       <Quantity>
         12
      </Quantity>
     </m:CheckAvailabilityResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

SOA Design Patterns by Thomas Erl
Foreword by Grady Booch
With contributions from David Chappell, Jason Hogg, Anish Karmarkar, Mark Little, David Orchard, Satadru Roy, Thomas Rischbeck, Arnaud Simon, Clemens Utschig, Dennis Wisnosky, and others.
Web Service Contract Design & Versioning for SOA by Thomas Erl, Anish Karmarkar, Priscilla Walmsley, Hugo Haas, Umit Yalcinalp, Canyang Kevin Liu, David Orchard, Andre Tost, James Pasley
SOA Principles of Service Design by Thomas Erl
Service-Oriented Architecture: A Field Guide to Integrating XML and Web Services by Thomas Erl
Service-Oriented Infrastructure:On-Premise and in the Cloud by Raj Balasubramanian, Benjamin Carlyle, Thomas Erl, Cesare Pautasso
Next Generation SOA:A Real-World Guide to Modern Service-Oriented Computing by Pethuru Cheliah, Thomas Erl, Clive Gee, Robert Laird, Berthold Maier, Hajo Normann, Leo Shuster, Bernd Trops, Clemens Utschig, Torsten Winterberg
SOA with .NET & Windows Azure: Realizing Service-Orientation with the Microsoft Platform by David Chou, John deVadoss, Thomas Erl, Nitin Gandhi, Hanu Kommalapati, Brian Loesgen, Christoph Schittko, Herbjorn Wilhelmsen, Mickey Williams
SOA Governance:
Governing Shared Services On-Premise & in the Cloud
by Stephen Bennett, Thomas Erl, Clive Gee, Anne Thomas Manes, Robert Schneider, Leo Shuster, Andre Tost, Chris Venable
SOA with Java by Raj Balasubramanian, David Chou, Thomas Erl, Thomas Plunkett, Satadru Roy, Philip Thomas, Andre Tost
Modern SOA Methodology: Methods for Applying Service-Orientation On-Premise & in the Cloud by Raj Balasubramanian, David Chou, Thomas Erl, Thomas Plunkett, Satadru Roy, Philip Thomas, Andre Tost
Cloud Computing: Concepts, Technology & Architecture by Thomas Erl, Zaigham Mahmood, Ricardo Puttini
Cloud Computing Design Patterns by Thomas Erl, Amin Naserpour

For more information about these books, visit: www.servicetechbooks.com


Arcitura Education Inc.
Arcitura Education Inc. is a leading global provider of progressive, vendor-neutral training and certification programs, providing industry-recognized certification programs for a range of certifications.
For more information:
www.arcitura.com
SOA Certified Professional (SOACP)
The books in this series are part of the official curriculum for the SOA Certified Professional program.
For more information:
www.soaschool.com
Cloud Certified Professional (CCP)
The books in this series are part of the official curriculum for the Cloud Certified Professional program.
For more information:
www.cloudschool.com
Big Data Science Certified Professional (BDSCP)
The books in this series are part of the official curriculum for the Big Data Science Certified Professional program.
For more information:
www.bigdatascienceschool.com/