SOAP 1.1

SOAP 1.1 is simply a distributed object protocol like DCOM, CORBA IIOP, and Java RMI-JRMP. The most significant difference between SOAP 1.1 and other distributed object protocols is that SOAP 1.1 is based on XML.

Tip

EJB 2.1 and the J2EE 1.4 platform are standardized on SOAP 1.1. At the time of this writing, SOAP 1.2 (the latest version of SOAP) has just been released, but it is not supported by J2EE 1.4/EJB 2.1. From this point forward, we’ll only talk about SOAP 1.1, which we’ll simply call SOAP.

SOAP is defined by its own XML Schema and relies heavily on the use of XML Namespaces. Every SOAP message that is sent across the wire is an XML document that consists of standard SOAP elements and application data. The use of namespaces differentiates the standard SOAP elements from the application data. Here’s a SOAP request message that might be sent from a client to a server:

<?xml version='1.0' encoding='UTF-8' ?>
<
               env:Envelope  xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
                  <env:Header />
                  <env:Body>
       <reservation xmlns="http://www.titan.com/Reservation>
             <customer>
                      <!-- customer info goes here -->
             </customer>
             <cruise-id>123</cruise-id>
             <cabin-id>333</cabin-id>
             <price-paid>6234.55</price-paid>
       </reservation>
   </env:Body>
               </env:Envelope>

The standard SOAP elements are shown in bold while the application data, the Reservation XML document fragment, is shown in regular text. SOAP’s primary purpose is to establish a standard XML framework for packaging application data that ...

Get Enterprise JavaBeans, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.