Information Technology Reference
In-Depth Information
rather than moving to the preferable and richer message-based model pro-
vided by Web Services.
8.4 SOAP and Messaging
Although adopting XML is an important step forward in dealing with het-
erogeneity and extensibility requirements, XML by itself is not sufficient for
two parties (the service provider and service consumer applications) to prop-
erly communicate. For effective communications, the parties must be able
to exchange messages according to an agreed-upon format. Simple Object
Access Protocol (SOAP) is such a protocol, providing a common message
format for services. SOAP originally stood for Simple Object Access Protocol,
but it is now officially no longer an acronym. SOAP clients send XML request
messages to service providers over any transport and can get XML response
messages back in return.
SOAP is a text-based messaging format that uses an XML-based data
encoding format. SOAP is independent of both the programming language
and the operational platform, and it does not require any specific technol-
ogy at the endpoints, thus making it completely agnostic toward vendors,
platforms, and technologies. It specifies a simple but extensible XML-based
application-to-application communication protocol, roughly equivalent to
DCE's RPC or Java's RMI, but much less complex and far easier to imple-
ment as a result. This simplicity comes from deliberately staying well away
from complex problems, such as distributed garbage collection and passing
objects by reference. Its text format also makes SOAP a firewall-friendly pro-
tocol. Although SOAP was originally designed to work only with HTTP, any
transport protocol or messaging middleware can be used to carry a SOAP
message. All that the SOAP standard does is define a simple but extensible
message-oriented protocol for invoking remote services, using HTTP, SMTP,
UDP, or other protocols as the transport layer and XML for formatting data.
The SOAP message is a complete (or valid) XML document, with the top
element being the envelope element. The envelope element contains a body
element and an optional header element. The body element usually carries
the actual message, which is consumed by the recipient. The header element
is generally used for advanced features for intermediate processors.
Listing 8.3 An example of SOAP message
<soap:envelope xmlns:soap = "http://schemas.xmlsoap.org/soap/
envelope/"
soap:encodingStyle = "http:/schemas.xmlsoap.org/soap/
encoding/"/>
<soap:header>
</soap:header>
Search WWH ::




Custom Search