blob: 4237c2756cb07487f899b535464f38eb4ed3c904 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2005, v.4002-->
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
"concept.dtd">
<concept id="csoap" xml:lang="en-us">
<title>SOAP</title>
<shortdesc>SOAP (formerly known as Simple Object Access Protocol) is a lightweight
protocol for the exchange of information in a decentralized, distributed environment.
A SOAP message is a transmission of information from a sender to a receiver.
SOAP messages can be combined to perform request/response patterns. </shortdesc>
<prolog><metadata>
<keywords><indexterm>SOAP<indexterm>overview</indexterm></indexterm>
<indexterm>Web services<indexterm>SOAP</indexterm></indexterm>
</keywords>
</metadata></prolog>
<conbody>
<p>SOAP is transport independent but is most commonly carried over HTTP in
order to run with the existing Internet infrastructure.&nbsp; SOAP enables
the binding and usage of discovered Web services by defining a message path
for routing messages. SOAP is used to query UDDI for Web services. The workbench
supports SOAP 1.1.</p>
<p>SOAP is an XML-based protocol that defines three parts to every message:</p>
<ul>
<li> <uicontrol>Envelope.</uicontrol>&nbsp; The envelope defines a framework
for describing what is in a message and how to process it.&nbsp; A SOAP message
is an envelope containing zero or more headers and exactly one body.&nbsp;
The envelope is the top element of the XML document, providing a container
for control information, the address of a message, and the message itself.&nbsp;
Headers transport any control information such as quality-of-service attributes.&nbsp;
The body contains the message identification and its parameters.&nbsp; Both
the headers and the body are child elements of the envelope.</li>
<li> <uicontrol>Encoding rules.</uicontrol>&nbsp; The set of encoding rules
expresses instances of application-defined data types. Encoding rules define
a serialization mechanism that can be used to exchange instances of application-defined
data types. SOAP defines a programming language-independent data type scheme
based on XSD plus encoding rules for all data types defined according to this
model. SOAP encoding is not WS-I compliant and thus the Literal use (which
is no encoding) is suggested for interoperable Web services and required for
WS-I compliance.</li>
<li> <uicontrol>Communication styles.</uicontrol> Communications can follow
a remote procedure call (RPC) or message-oriented (Document) format.&nbsp;
These are discussed below.</li>
</ul>
<section><title>Binding styles</title><p>SOAP supports two different communication
styles:</p><lq> <p> <uicontrol>Remote procedure call (RPC):</uicontrol>&nbsp;
Invocation of an operation returning a result. Typically used with SOAP encoding,
which is not WS-I compliant.</p><p> <uicontrol>Document Style:</uicontrol>&nbsp;
Also known as document-oriented or message-oriented style.&nbsp; This style
provides a lower layer of abstraction, and requires more programming work.</p> </lq></section>
<section><title>Encoding styles</title><p>In distributed computing environments,
encoding styles define how data values defined in the application can be translated
to and from a particular protocol format.&nbsp; The translation process is
know as serialization and deserialization.</p><p>The SOAP specification defines
the SOAP encoding style:</p><lq> <p> <uicontrol>SOAP encoding:</uicontrol>&nbsp;
The SOAP encoding style allows you to serialize/deserialize values of data
types from the SOAP data model.&nbsp; This encoding style is defined in the
SOAP 1.1 standard, and is not WS-I compliant.</p> </lq><p>WSDL defines the
Literal XML encoding style:</p><lq> <p> <uicontrol>Literal XML:</uicontrol>&nbsp;
Literal refers to the fact that the document should be read as-is, or unencoded.
The document is serialized as XMI, meaning that the message XML complies with
the Schema in the WSDL. When using Literal encoding, each message part references
a concrete schema definition. Literal encoding is WS-I compliant.</p> </lq></section>
<section><title>Data model</title><p>The purpose of the SOAP data model is
to provide a language-independent abstraction for data types used by common
programming language types.&nbsp;It consists of:</p><ul>
<li> <uicontrol>Simple XSD types.</uicontrol>&nbsp; For example int, string,
and date.</li>
<li> <uicontrol>Compound types.</uicontrol>&nbsp; There are two kinds of compound
types, <varname>structs</varname> and <varname>arrays</varname>.&nbsp; Structs
are named aggregate types in which each element has a unique name or XML tag.&nbsp;
Arrays have elements that are identified by position, not by name.</li>
</ul><p>All elements and identifiers comprising the SOAP data model are defined
in the namespace URI.&nbsp; The SOAP standard defines the rules for how data
types can be constructed. A project specific XML schema must define the actual
data types. The elements of the SOAP specification are defined in <xref format="html"
href="http://schemas.xmlsoap.org/soap/envelope/" scope="external">http://schemas.xmlsoap.org/soap/envelope/</xref> and
<xref format="html" href="http://schemas.xmlsoap.org/soap/encoding/" scope="external">http://schemas.xmlsoap.org/soap/encoding/</xref></p></section>
<section><title>SOAP implementations</title><p>Different implementations of
the SOAP protocol are available today.&nbsp; For example, the Apache Foundation
provides Apache SOAP, which grew out of an <tm tmclass="ibm" tmowner="IBM Corporation"
tmtype="reg" trademark="IBM">IBM</tm> project called SOAP4J, as well as Apache
Axis and the <tm tmclass="ibm" tmowner="IBM Corporation" tmtype="reg" trademark="IBM">IBM</tm> <tm
tmclass="ibm" tmowner="IBM Corporation" tmtype="reg" trademark="WebSphere">WebSphere</tm> run-time
environment. The provided Web services tools support Apache SOAP 2.3, Axis
1.3, and <tm tmclass="ibm" tmowner="IBM Corporation" tmtype="reg" trademark="IBM">IBM</tm> <tm
tmclass="ibm" tmowner="IBM Corporation" tmtype="reg" trademark="WebSphere">WebSphere</tm> implementations.</p></section>
<section><title>Mappings</title><p>A mapping defines an association between
a qualified XML element name, a <tm tmclass="special" tmowner="Sun Microsystems, Inc."
tmtype="tm" trademark="Java">Java</tm> class name, and an encoding style.&nbsp;
The mapping specifies how, under the given encoding, an incoming XML element
with a fully qualified name is converted to a <tm tmclass="special" tmowner="Sun Microsystems, Inc."
tmtype="tm" trademark="Java">Java</tm> class and vice versa.</p><p>For more
information on Apache SOAP, refer to <xref format="html" href="http://xml.apache.org/soap"
scope="external">xml.apache.org/soap</xref>&nbsp; For more information on
SOAP refer to <xref format="html" href="http://www.w3.org/TR/SOAP" scope="external">www.w3.org/TR/SOAP</xref> </p></section>
</conbody>
<related-links>
<linklist><title>Related Concepts</title>
<link href="cws.dita"><linktext>Web services overview</linktext></link>
<link href="cwsinwsa.dita"><linktext>Tools for Web services development</linktext>
</link>
</linklist>
<linklist><title>Related Tasks</title>
<link href="../tasks/toverws.dita" scope="peer"><linktext> Developing Web
services</linktext></link>
</linklist>
</related-links>
</concept>