Web Service Protocols (WS-*)

Web-Based Services (INFOSYS 290-3)

Erik Wilde, UC Berkeley iSchool
Wednesday, October 11, 2006
Creative Commons License

This work is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 2.5 License.

Abstract

SOAP is a format for message exchange between Web Service peers. SOAP does only define very basic semantics for message headers. A multitude of WS-* specifications has been developed to extend SOAP with semantics which can then be reused in various application scenarios. WS-* specifications range from very simple header conventions to highly complex infrastructures, depending on how complex the problem is they are trying to solve.

SOAP is Messaging

Outline (WS-*)

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

Closing Open Standards

WS-Anything

SOAP Example Message

<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
 <env:Header>
  <m:reservation xmlns:m="http://travelcompany.example.org/reservation" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true">
   <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
   <m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime>
  </m:reservation>
  <n:passenger xmlns:n="http://mycompany.example.com/employees" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true">
   <n:name>Åke Jógvan Øyvind</n:name>
  </n:passenger>
 </env:Header>
 <env:Body>
  <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel">
   <p:departure>
    <p:departing>New York</p:departing>
    <p:arriving>Los Angeles</p:arriving>
    <p:departureDate>2001-12-14</p:departureDate>
    <p:departureTime>late afternoon</p:departureTime>
    <p:seatPreference>aisle</p:seatPreference>
   </p:departure>
   <p:return>
    <p:departing>Los Angeles</p:departing>
    <p:arriving>New York</p:arriving>
    <p:departureDate>2001-12-20</p:departureDate>
    <p:departureTime>mid-morning</p:departureTime>
    <p:seatPreference/>
   </p:return>
  </p:itinerary>
  <q:lodging xmlns:q="http://travelcompany.example.org/reservation/hotels">
   <q:preference>none</q:preference>
  </q:lodging>
 </env:Body>
</env:Envelope>

Outline (Extending SOAP)

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

SOAP Messages

absent none next ultimateReceiver
initial sender n/a n/a n/a n/a
intermediary no no yes no
ultimate receiver yes no yes yes

SOAP and XML Namespaces

WS-* in Practice

Outline (WS-Addressing)

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

Flexible Addressing

Simple Example (Request)

<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <S:Header> 
  <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID>
    <wsa:ReplyTo>
      <wsa:Address>http://example.com/business/client1</wsa:Address>
    </wsa:ReplyTo>
    <wsa:To>mailto:fabrikam@example.com</wsa:To>
    <wsa:Action>http://example.com/fabrikam/mail/Delete</wsa:Action>
  </S:Header>
  <S:Body>
    <f:Delete xmlns:f="http://example.com/fabrikam">     
       <maxCount>42</maxCount>
    </f:Delete>
  </S:Body>
</S:Envelope>

Simple Example (Reply)

<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <S:Header>
    <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID>
    <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo>
    <wsa:To>http://example.com/business/client1</wsa:To>
    <wsa:Action>http://example.com/fabrikam/mail/DeleteAck</wsa:Action>
  </S:Header>
  <S:Body>
    <f:DeleteAck xmlns:f="http://example.com/fabrikam"/>
  </S:Body>
</S:Envelope>

Fault Handling

<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2004/12/addressing">
    <S:Header>
        <wsa:MessageID>http://example.com/SomeUniqueMessageIdString</wsa:MessageID>
        <wsa:ReplyTo>
            <wsa:Address>http://myClient.example/someClientUser</wsa:Address>
        </wsa:ReplyTo>
        <wsa:FaultTo>
            <wsa:Address>http://myserver.example/DemoErrorHandler</wsa:Address>
        </wsa:FaultTo>
        <wsa:To>http://myserver.example/DemoServiceURI</wsa:To>
        <wsa:Action>http://myserver.example/DoSomething</wsa:Action>
    </S:Header>
    <S:Body>
        <!-- The message body of the SOAP request appears here -->
    </S:Body>
</S:Envelope>

Address Translation

Outline (WS-Choreography (WS-CDL))

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

Service Interactions

Example Scenario

Outline (WS-Security (WSS))

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

SOAP is Insecure

Securing SOAP Message Exchanges

Encrypting Message Contents

WSS Functionality

Digital Signatures

Outline (WS-Policy)

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

Negotiable Policies

WS-Policy Example

<wsp:Policy xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
  <sp:TransportBinding>
    <wsp:Policy>
      <sp:AlgorithmSuite>
        <wsp:Policy>
          <wsp:ExactlyOne>
            <sp:Basic256Rsa15/>
            <sp:TripleDesRsa15/>
          </wsp:ExactlyOne>
        </wsp:Policy>
      </sp:AlgorithmSuite>
      <sp:TransportToken>
        <wsp:Policy>
          <sp:HttpsToken RequireClientCertificate="false"/>
        </wsp:Policy>
      </sp:TransportToken>
    </wsp:Policy>
  </sp:TransportBinding>
</wsp:Policy>

WS-SecurityPolicy

Outline (WS-Inspection)

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

Describing Services

WS-Inspection = (G)RDDL4WS

Outline (Conclusions)

  1. WS-* [23]
    1. Extending SOAP [3]
    2. WS-Addressing [5]
    3. WS-Choreography (WS-CDL) [2]
    4. WS-Security (WSS) [5]
    5. WS-Policy [3]
    6. WS-Inspection [2]
  2. Conclusions [1]

Too Many Specifications

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.

C. A. R. Hoare, The Emperor's Old Clothes, 1980 Turing Award Lecture