Proposal for Conversation Web Services Binding

The following is a proposed standard for a web services message exchange pattern to establish a conversation ID between client and server for SCA conversational support.

Motivation

Other existing open web services standards don't cover or completely specify an exchange to establish a conversation in a fully interoperable manor.

Overview

The following proposes using a wsa:From EPR in the SOAP header upon the first invocation of an operation on an interface with a conversation scope to contain the conversation id.

Example SCA Conversation EPR

<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <S:Header> 
    <wsa:From xmlns:scaNS="http://www.osoa.org/xmlns/sca/1.0">
      <wsa:Address>http://someuri</wsa:Address>
      <wsa:ReferenceParameters>
        <scaNS:conversationID>xs:any*</scaNS:conversationID>
      </wsa:ReferenceParameters>
    </wsa:From>
   </S:Header>
  <S:Body>
  ....
  </S:Body>
</S:Envelope>

/wsa:From

/wsa:From/wsa:Address

/wsa:From/wsa:ReferenceParameters

/wsa:From/wsa:ReferenceParameters/scaNS:conversationID

All other elements MUST conform as specified in WS-Addressing's wsa:EndpointReference.

Optionally, the response MAY contain in a SOAP HEADER element a wsa:From EPR which is to be used for subsequent operations in the conversation. If not present the Request wsa:From EPR will be used.

Example calculator exchange. Sum numbers, get result

@Scope("CONVERSATION")
@Remotable
public interface Calculator{
  public void add( int op);
  public int getSum();
  @EndConversation
  public void off(); //Turn calculator off. End conversation.
}

Operation to add 1 to sum:

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:From xmlns:scaNS="http://www.osoa.org/xmlns/sca/1.0">
      <wsa:Address>http://calculator/sum</wsa:Address>
      <wsa:ReferenceParameters>
        <scaNS:conversationID>03c77215-4717-11d8-ac80-0090272ff725</scaNS:conversationID>
      </wsa:ReferenceParameters>
    </wsa:From>
  </S:Header>
  <S:Body>
    <calc:add  xmlns:calc="http://calculator/sum">1</calc:add>
  </S:Body>
</S:Envelope>

Response:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  <S:Body>
    <calc:addResponse xmlns:calc="http://calculator/sum"/>
  </S:Body>
</S:Envelope>

Operation add 3 to sum:

Request:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <S:Header> 
        <scaNS:conversationID>03c77215-4717-11d8-ac80-0090272ff725</scaNS:conversationID>
  </S:Header>
  <S:Body>
    <calc:add  xmlns:calc="http://calculator/sum">3</calc:add>
  </S:Body>
</S:Envelope>

Response:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  <S:Body>
    <calc:addResponse xmlns:calc="http://calculator/sum"/>
  </S:Body>
</S:Envelope>

Operation get sum:

Request:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <S:Header> 
        <scaNS:conversationID>03c77215-4717-11d8-ac80-0090272ff725</scaNS:conversationID>
  </S:Header>
  <S:Body>
    <calc:getSum  xmlns:calc="http://calculator/sum"/>
  </S:Body>
</S:Envelope>

Response:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  <S:Body>
    <calc:geSumtResponse xmlns:calc="http://calculator/sum">4</calc:geSumtResponse>
  </S:Body>
</S:Envelope>

Operation Off:

Request:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <S:Header> 
        <scaNS:conversationID>03c77215-4717-11d8-ac80-0090272ff725</scaNS:conversationID>
  </S:Header>
  <S:Body>
    <calc:off xmlns:calc="http://calculator/sum"/>
  </S:Body>
</S:Envelope>

Response:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
  <S:Body>
    <calc:offResponse xmlns:calc="http://calculator/sum" />
  </S:Body>
</S:Envelope>