GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



next up previous contents
Next: SOAP RPC Representation Up: SOAP Previous: SOAP   Contents

SOAP Messages


A SOAP message, an XML document and basic unit of SOAP communication, consists of five different elements, see figure [*]. The first element, SOAP envelope, is the outermost element of a SOAP message. The second element, SOAP header, is an element which serves to contain zero or more ``SOAP header block'' elements. A SOAP header block is an element which according to the Good Book ``logically constitutes a single computational unit within the SOAP header.'' Getting the Babel fish out, placing it firmly in ear, ok. Now I'll translate that last definition in to English, but first we have to grok a few more definitions. A SOAP message, need not simply be launched from the sender, known as an initial SOAP sender, to a receiver, known as an ultimate SOAP receiver. A SOAP message may actually pass through several hands, each of which is known as a SOAP intermediary, before reaching the ultimate SOAP receiver. Each one of these SOAP intermediaries may process a given SOAP header block. So, a SOAP header block can be construed as a logical computational unit for a SOAP intermediary. The fourth part of a SOAP message is the SOAP body which is a collection of zero or more ``SOAP body sub-elements.'' The final element in a SOAP message is the SOAP body sub-element which contains information which is to be delivered to the ultimate SOAP receiver in the SOAP message path, the set of nodes which a SOAP message traverses during its life's arc.

Figure: Structure of a SOAP message.
[width=7cm]soap

To get a feeling for what these parts of a SOAP message look like in practice lets take a peek at an example SOAP message

<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" >
 <env:Header>
   <t:transaction
           xmlns:t="http://thirdparty.example.org/transaction"
           env:encodingStyle="http://example.com/encoding"
           env:mustUnderstand="true" >5</t:transaction>
 </env:Header>  
 <env:Body>
  <m:chargeReservation 
      env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
         xmlns:m="http://www.travelcompany.fr/">
   <m:reservation xmlns:m="http://www.travelcompany.fr/reservation">
    <m:code>FT35ZBQ</m:code>
   </m:reservation>   
   <o:creditCard xmlns:o="http://www.travelcompany.fr/financial">
    <n:name xmlns:n="http://www.travelcompany.fr/employees">
           Leonardo Da Vinci
    </n:name>     
    <o:number>123456789099999</o:number>
    <o:expiration>2005-02</o:expiration>
   </o:creditCard>
  </m:chargeReservation>
 </env:Body>
</env:Envelope>

The SOAP envelope of this message is

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

The header is

<env:Header>
   <t:transaction
           xmlns:t="http://thirdparty.example.org/transaction"
           env:encodingStyle="http://example.com/encoding"
           env:mustUnderstand="true" >5</t:transaction>
</env:Header>

and there exists a single header block given by

<t:transaction
        xmlns:t="http://thirdparty.example.org/transaction"
        env:encodingStyle="http://example.com/encoding"
        env:mustUnderstand="true" >5</t:transaction>

The SOAP body of this message is

<env:Body>
 <m:chargeReservation 
     env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
        xmlns:m="http://www.travelcompany.fr/">
  <m:reservation xmlns:m="http://www.travelcompany.fr/reservation">
   <m:code>FT35ZBQ</m:code>
  </m:reservation>   
  <o:creditCard xmlns:o="http://www.travelcompany.fr/financial">
   <n:name xmlns:n="http://www.travelcompany.fr/employees">
          Leonardo Da Vinci
   </n:name>     
   <o:number>123456789099999</o:number>
   <o:expiration>2005-02</o:expiration>
  </o:creditCard>
 </m:chargeReservation>
</env:Body>

and contains a single SOAP body sub-element

<m:chargeReservation 
    env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
       xmlns:m="http://www.travelcompany.fr/">
 <m:reservation xmlns:m="http://www.travelcompany.fr/reservation">
  <m:code>FT35ZBQ</m:code>
 </m:reservation>   
 <o:creditCard xmlns:o="http://www.travelcompany.fr/financial">
  <n:name xmlns:n="http://www.travelcompany.fr/employees">
         Leonardo Da Vinci
  </n:name>     
  <o:number>123456789099999</o:number>
  <o:expiration>2005-02</o:expiration>
 </o:creditCard>
</m:chargeReservation>

In addition to these five SOAP message components there exists a sixth ``component.'' A SOAP message can indicates that an error occurred during processing by including the distinguished element Fault as a SOAP body sub-element. For example, a Fault message could look as follows

<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
            xmlns:rpc='http://www.w3.org/2003/05/soap-rpc'>
  <env:Body>
   <env:Fault>
    ...
   </env:Fault>
 </env:Body>
</env:Envelope>


next up previous contents
Next: SOAP RPC Representation Up: SOAP Previous: SOAP   Contents
Andre Merzky 2004-05-13