SOAP

Properties of Traditional Web Service

Web Service Protocol Stack

A Common Web Service Protocol Stack

Simple Object Access Protocol (SOAP)

SOAP Message Format

<?xml version="1.0"?>
<example:Envelope xmlns:example="..."
      xmlns:encodingStyle="..." >

  <example:Header>
  ...
  </example:Header>

  <example:Body>
    ...
    <example:Fault>
    ...
    </example:Fault>
  </example:Body>

</example:Envelope>

SOAP Envelope Element

SOAP Header Element

SOAP Body Element

SOAP Fault Element

SOAP and HTTP

Example SOAP Request

POST www.example.com/HasName HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<n:Envelope
xmlns:n="http://www.w3.org/2003/05/soap-envelope/"
n:encodingStyle="http://www.w3.org/2003/05/soap-encoding/">

<n:Body xmlns:m="http://www.example.com/name">
  <m:GetAge>
    <m:Name>Bob</m:Name>
  </m:GetAge>
</n:Body>

</n:Envelope>

Example SOAP Response

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<n:Envelope
xmlns:n="http://www.w3.org/2003/05/soap-envelope/"
n:encodingStyle="http://www.w3.org/2003/05/soap-encoding/">

<n:Body xmlns:m="http://www.example.com/name">
  <m:GetAgeResponse>
    <m:Age>18</m:Age>
  </m:GetAgeResponse>
</n:Body>

</n:Envelope>

Web Services Description Language (WSDL)

WSDL Document Structure

<definitions>
  <types>
    definition of types ...
  </types>
  <message>
    definition of a message ...
  </message>
  <portType>
    <operation>
      definition of an operation ...
    </operation>
  </portType>
  <binding>
    definition of a binding ...
  </binding>
  <service>
    definition of a service ...
  </service>
</definitions>

WSDL definitions element

WSDL types element

WSDL message element

WSDL portType element

WSDL Operation Types

WSDL binding Element

WSDL binding Element Example

<binding name="Hello_Binding"
  type="tns:Hello_PortType>
  <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="hello">
    <soap:operation soapAction="hello"/>
    <input>
      <soap:body encodingStyle="..."
        namespace="..."
        use="encoded"/>
    </input>
    <output>
      <soap:body encodingStyle="..."
        namespace="..."
        use="encoded"/>
    </output>
  </operation>
</binding>

WSDL port Element

WSDL service Element

Universal Description, Discovery, and Integration (UDDI)

UDDI Elements

Three types of information can be registered into a UDDI registry by a business or company:

UDDI Data Structures

UDDI includes an XML Schema that describes the following data structures

UDDI Inquiry Interface

UDDI Publisher Interface