SOAP is a
lightweight specification protocol used to invoke methods on
servers, components and objects so as to exchange information
in a decentralized, distributed environment. This XML-based
protocol, transported by HTTP, can be broken down into three
parts:
The structure of the SOAP envelope (Payload) defines
a general structure expressing the content, processing party
and optional/ mandatory nature of a message.
The SOAP encoding rules define a serialization
mechanism that can be used to exchange instances of
application-defined datatypes.
Soap's Remote Protocol Call defines a convention,
which can be used to represent remote procedure calls and
their responses.
The XML
part of every SOAP message contains particular tags and
attributes. It consists of:
The SOAP
envelope: this is the first element in the XML document
representing the message.
The
(optional) SOAP header: this is a generic mechanism that
adds characteristics to the SOAP message. SOAP defines
several attributes that can be used to indicate who must
process the characteristics, and whether this process is
optional or mandatory.
The SOAP
body: this is the container for the mandatory information
being sent to the message endpoint.
XML
Structure
SOAP
Envelope This is the first part of the SOAP message and
it is mandatory. It contains the name of the element
(Envelope), followed by a namespace defining the SOAP version
being used, and the optional encodingStyle attribute which
points to a link where the serialization (tree structure) and
encoding rules are defined. The envelope is presented as
follows:
Namespaces
are used to provide a context and guarantee the uniqueness of
elements associated in this way.
SOAP
Header This is an optional part of the SOAP message
encapsulated in the SOAP envelope. It carries information to
intermediaries, and is made up of one of more entries. These
bear a local name, a full name, a namespace and the two actor
attributes which designate the endpoint of the entry, and
mustUnderstand, which indicates the optional nature of the
process. A SOAP application must include a correct SOAP
namespace for all the elements and attributes defined in the
message generated. This is a URI which points to a description
of the message information in order to guarantee the
uniqueness of the message. DTDs are never
used.
SOAP
Body The information to be processed by the endpoint is
found in the body of the SOAP message. This can contain a set
of entries which are all kept in the root of the message body.
The http
protocol is used so that the SOAP message will be transported
effectively.
HTTP
Structure
HTTP
Header The HTTP
header is found just before the SOAP message. The HTTP
protocol sends a POST request via the network. The code
lines are as follows:
In the
first line, the send method, URI request and protocol version
are defined:
POST /Computer
HTTP/1.1
The next
line gives the target site:
Host:
www.techmetrix.com
The next
three lines are used to define the MIME format for message
display, the HTTP coding and the length of the
message.
Then,
methods are added such as SOAPAction (a.k.a. SOAPMethodName)
which determines the intention of the HTTP request. The
identifier following the # sign must match the name of the
first tag in the SOAP message body.
TechMetrix Research is a technically
focused analyst firm focused on e-business application development needs.
Based in Boston, Mass., the firm publishes comparison reports and product
reviews designed to aid enterprises with decision making and to keep pace
with the fast-moving e-business market.
TechMetrix is a U.S.-based subsidiary
of SQLI, a European company that offers on-site development services to
international organizations. SQLI specializes in e-business project
development.