HomeDigital EditionSys-Con RadioSearch Web Services Cd
B2B Beginning WS Business Process Management Case Studies Content Management Distributing Computing e-Business Electronic Data Interchange Enterprise Industry Insight Integration Interviews Java & Web Services .NET Portal Product Reviews Scalability & Performance Security SOAP Source Code UDDI Wireless WS Standards WS Tips & Techniques WSDL WS Editorials XML

Introducing WS-Coordination by Dr. Jim Webber & Dr. Mark Little
WSJ Vol 03 Issue 05 - pg.16



Listing 1:  Activation Service WSDL Interfaces

<!-- Activation Service portType Declaration -->
<wsdl:portType name="ActivationCoordinatorPortType">
  <wsdl:operation name="CreateCoordinationContext">
    <wsdl:input 
     message="wscoor:CreateCoordinationContext"/>
  </wsdl:operation>
</wsdl:portType>

<!-- Activation Requester portType Declaration -->
<wsdl:portType name="ActivationRequesterPortType">
  <wsdl:operation 
    name="CreateCoordinationContextResponse">
    <wsdl:input 
     message="wscoor:CreateCoordinationContextResponse"/>
  </wsdl:operation>
  <wsdl:operation name="Error">
    <wsdl:input message="wscoor:Error"/>
  </wsdl:operation>
</wsdl:portType>

Listing 2: Registration Service WSDL Interface

<!-- Registration Service portType Declaration -->
<wsdl:portType name="RegistrationCoordinatorPortType">
  <wsdl:operation name="Register">
      <wsdl:input message="wscoor:Register"/>
  </wsdl:operation>
</wsdl:portType>

<!-- Registration Requester portType Declaration -->
<wsdl:portType name="RegistrationRequesterPortType">
  <wsdl:operation name="RegisterResponse">
      <wsdl:input message="wscoor:RegisterResponse"/>
  </wsdl:operation>
  <wsdl:operation name="Error">
      <wsdl:input message="wscoor:Error"/>
  </wsdl:operation>
</wsdl:portType>

Listing 3: WS-Coordination Context Schema Fragment

<xs:complexType name="CoordinationContextType" 
    abstract="false">
  <xs:complexContent>
    <xs:extension base="wsu:ContextType">
      <xs:sequence>
        <xs:element name="CoordinationType" 
            type="xs:anyURI" /> 
        <xs:element name="RegistrationService" 
            type="wsu:PortReferenceType" /> 
        <xs:any namespace="##any" processContents="lax" 
            minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

Listing 4: Security Coordination Activation Message

<soap:Envelope
    xmlns:soap="http://www.w3.org/2002/06/soap-envelope">
  <soap:Body>
    <CreateCoordinationContext   
    xmlns="http://schemas.xmlsoap.org/ws/2002/08/wscoor" 
    xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" 
    xmlns:security="http://security.example.org/authentication">
      <ActivationService>
        <wsu:Address>
          http://activation.example.org
        </wsu:Address>
        <security:loginID>
           a.n@other.com
        </security:loginID>
        <security:password>
          foobar
        </security:password>
      </ActivationService>
      <RequesterReference>
        <wsu:Address>
          http://workstation.example.org/station101
        </wsu:Address>
      </RequesterReference>
      <CoordinationType>
        http://security.example.org/single-logon
      </CoordinationType>
    </CreateCoordinationContext>
  </soap:Body>
</soap:Envelope>

Listing 5:  A Security Context

<soap:Envelope
    xmlns:soap="http://www.w3.org/2002/06/soap-envelope">
  <soap:Body>
    <CreateCoordinationContextResponse 
    xmlns="http://schemas.xmlsoap.org/ws/2002/08/wscoor"       
    xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"     
    xmlns:security="http://security.example.org/authentication">
      <RequesterReference>
        <wsu:Address>
          http://workstation.example.org/station101
        </wsu:Address>
      </RequesterReference>
      <CoordinationContext>
        <CoordinationType>
          http://security.example.org/single-logon
        </CoordinationType>
        <RegistrationService>
          <wsu:Address>
            http://security.example.org/registration
          </wsu:Address>
          <security:token>
            1234-5678-9ABC-DEF0
          </security:token>
        </RegistrationService>
      </CoordinationContext>
    </CreateCoordinationContextResponse>
  </soap:Body>
</soap:Envelope>

Listing 6  Security Protocol Completion Request Message

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
  xmlns:soap="http://www.w3.org/2002/06/soap-envelope"   
  xmlns:wscoor="http://schemas.xmlsoap.org/ws/2002/08/wscoor" 
  xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" 
  xmlns:sec="http://security.example.org/authentication" 
  xmlns:comp="http://security.example.org/authentication/
				completion">
  <soap:Body>
    <comp:logout>
      <wscoor:RequesterReference>
        <wsu:Address>
          http://workstation.example.org/station101
        </wsu:Address>
      </wscoor:RequesterReference>
      <sec:loginID>
        a.n@other.com
      </sec:loginID>
      <sec:password>
        foobar
      </sec:password>
    </comp:logout>
  </soap:Body>
</soap:Envelope>

Listing 7  signOut and signedOut Message Contents

<!--The signOut message contents -->
<comp:signOut>
  <wscoor:RequesterReference>
    <wsu:Address>
      http://security.example.org/logout-service
     </wsu:Address>
  </wscoor:RequesterReference>
  <sec:loginID>
    a.n@other.com
  </sec:loginID>
</comp:signOut>

<!--The signedOut message contents -->
<comp:signedOut>
  <wscoor:RequesterReference>
    <wsu:Address>
      http://printer.example.org/logout-service
    </wsu:Address>
  </wscoor:RequesterReference>
  <sec:loginID>
    a.n@other.com
  </sec:loginID>
</comp:signOut>

Listing 8  The loggedOut Message indicates session termination

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
  xmlns:soap="http://www.w3.org/2002/06/soap-envelope"   
  xmlns:wscoor="http://schemas.xmlsoap.org/ws/2002/08/wscoor" 
  xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" 
  xmlns:sec="http://security.example.org/authentication" 
  xmlns:comp="http://security.example.org/authentication/completion">
  <soap:Body>
    <comp:loggedout>
      <wscoor:RequesterReference>
        <wsu:Address>
          http://security.example.org/authentication</wsu:Address>
      </wscoor:RequesterReference>
      <sec:loginID>
        a.n@other.com
      </sec:loginID>
    </comp:loggedout>
  </soap:Body>
</soap:Envelope>