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.
- WSA Specifies the form and semantics of an Endpoint reference (EPR). It doesn't cover how endpoint references are created or exchanged.
- WSRF does not standardize how EPRs to stateful resources are created. In addition, it specifies resource properties which go beyond SCA conversational requirements.
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
- This element contained in the SOAP HEADER is recognized as the beginning of a new SCA conversation when it contains
a scaNS:conversationID reference parameter discussed below.
It is of type http://www.w3.org/2005/08/addressing EndpointReferenceType
/wsa:From/wsa:Address
This element contained in the scaNS:ConversationReference element specifies the [address] property of the endpoint reference. It may be http://www.w3.org/2005/08/addressing/anonymous.
/wsa:From/wsa:ReferenceParameters
This element contained in the scaNS:ConversationReference element is identical to it use in WS-A except its use is REQUIRED.
/wsa:From/wsa:ReferenceParameters/scaNS:conversationID
This REQUIRED element contained in a wsa:ReferenceParameters element contains the XML representation of the 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>