Asynch scenarios using a variety of underlying protocols, wsdl meps, and *To values

Author: David Orchard, BEA Systems

Date: July 13th 2005

Table of Contents

  1. Purpose
  2. One Way Protocol
    1. In-only
    2. Robust In-only
    3. In-out
    4. Out-only
  3. Protocols with Back Channel, aka Two-way
    1. In-only
    2. Robust In-only
      1. Robust In-only no FaultTo Fault generated
      2. Robust In-only no FaultTo no Fault generated
      3. Robust In-only FaultTo
    3. In-out
      1. In-out no ReplyTo
      2. In-out ReplyTo
        1. In-out ReplyTo no Fault generated
        2. In-out ReplyTo Fault propagated on back-channel
  4. Appendix: Complex Scenarios
    1. Protocol Switch
    2. Polling
    3. Protocol Response contains Request

Purpose

This document illustrates a number of ws-addressing scenarios with wsdl and soap fragment exemplars. It is intended for Web services related working groups to use for their designs and deliberations. This does not replace any existing specifications.

The term "two-way" protocol means a protocol that has a back-channel for responses. The canonical example is HTTP.

One Way Underlying Protocol

Binding uses an underlying protocol with no implicit return path for messages. The message template for protocol identified by the "mythical-oneway" uri schema and specified in wsdl 2.0 by the type="http://www.openuri.org/mythical-oneway/soap/" attribute and wsdl 1.1 by the onewayprotocol:binding transport="http://tempuri.org/mythical-oneway" element and attribute is
send DNSentry URI-path
message


In-only

diagram

WSDL 1.1

full
fragment:

<portType name="ServicePortType"> <operation name="Ping"> <input message="s0:PingMessageIn"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <onewayprotocol:binding transport="http://tempuri.org/mythical-oneway" style="document" /> <operation name="Ping"> <onewayprotocol:operation style="document" /> <input name="Ping"> <onewayprotocol:body use="literal" /> </input> </operation> </binding>

WSDL 2.0

full n/a
fragment:

<interface name="ServiceInterface"> <operation name="Ping" pattern="http://www.w3.org/@@@@/@@/wsdl/in-only"> <input element="s0:PingMessageIn"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="="http://www.openuri.org/mythical-oneway/soap/" /> <wsa:UsingAddressing/> <operation ref="s0:Ping" /> </binding>

SOAP mythical one-way

full soap body
fragment:

send example.com /Ping <soap:envelope> <soap:header> <wsa:Action>Ping</wsa:Action> </soap:header> </soap:envelope>

Robust In-only

diagram

WSDL 1.1

Note: unsure whether a WSDL 2.0 MEP could be retrofitted into WSDL 1.1 via WS-A.

WSDL 2.0

full n/a
fragment:

<interface name="ServiceInterface"> <operation name="EchoFault" pattern="http://www.w3.org/@@@@/@@/wsdl/robust-in-only"> <input element="s0:EchoFault"/> <outfault ref="s0:Fault"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="http://www.openuri.org/mythical-oneway/soap/" /> <wsa:UsingAddressing/> <operation ref="s0:EchoFault" /> </binding>

SOAP

full request full response
fragment:

send example.com /EchoFault <soap:envelope> <soap:header> <wsa:Action>http://tempuri.org/ServicePortType/EchoFault</wsa:Action> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:FaultTo> <wsa:Address>mythical-oneway://example.com/Fault</wsa:Address> <wsa:ReferenceParameters> <rp:CustomerKey xmlns:rp="http://tempuri.org/ReferenceParameters/Headers">ABCDEF</rp:CustomerKey> </wsa:ReferenceParameters> </wsa:FaultTo> </soap:header> </soap:envelope> send example.com /Fault <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/anotheruniquestring</wsa:MessageID> <wsa:Action>http://schemas.xmlsoap.org/ws/2004/03/addressing/fault</wsa:Action> <rp:CustomerKey xmlns:rp="http://tempuri.org/ReferenceParameters/Headers" wsa:isReferenceParameter="true">ABCDEF</rp:CustomerKey> </soap:header> <soap:Body> <soap:Fault/> </soap:Body> </soap:envelope>

In-Out

diagram

WSDL 1.1

full
fragment:

<portType name="ServicePortType"> <operation name="EchoString"> <input message="s0:EchoStringMessageIn"/> <output message="s0:EchoStringMessageOut"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <onewayprotocol:binding transport="http://tempuri.org/mythical-oneway" style="document" /> <operation name="EchoString"> <onewayprotocol:operation style="document" /> <input name="EchoString"> <onewayprotocol:body use="literal" /> </input> </operation> </binding>

WSDL 2.0

full n/a
fragment:

<interface name="ServiceInterface"> <operation name="EchoString" pattern="http://www.w3.org/@@@@/@@/wsdl/in-out">> <input element="s0:EchoStringMessageIn"/> <output element="s0:EchoStringMessageOut"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="="http://www.openuri.org/mythical-oneway/soap/" /> <wsa:UsingAddressing/> <operation ref="s0:EchoString" /> </binding>

SOAP

full request full response
fragment:

send example.com /EchoString <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoString</wsa:Action> <wsa:ReplyTo> <wsa:Address>mythical-oneway://example.com/Reply</wsa:Address> </wsa:ReplyTo> </soap:header> </soap:envelope> send example.com /Reply <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoStringResponse</wsa:Action> </soap:header> </soap:envelope>

Out-only

diagram

WSDL 1.1

full n/a
fragment:

<portType name="ServicePortType"> <operation name="Ping"> <output message="s0:PingMessageIn"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <onewayprotocol:binding transport="http://tempuri.org/mythical-oneway" style="document" /> <operation name="Ping"> <onewayprotocol:operation style="document" /> <output name="Ping"> <onewayprotocol:body use="literal" /> </output> </operation> </binding>

WSDL 2.0

full n/a
fragment:

<interface name="ServiceInterface"> <operation name="Ping" pattern="http://www.w3.org/@@@@/@@/wsdl/out-only"> <output element="s0:PingMessageIn"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="="http://www.openuri.org/mythical-oneway/soap/" /> <wsa:UsingAddressing/> <operation ref="s0:Ping" /> </binding>

SOAP mythical one-way

full soap body
fragment:

send example.com /Ping <soap:envelope> <soap:header> <wsa:Action>Ping</wsa:Action> </soap:header> </soap:envelope> Note: How does the service "know" that the ping should be sent to mythical-oneway://example.com/Ping?

Two Way Underlying Protocol

Binding uses an underlying protocol with an implicit back-channel for returning messages.


In-only

diagram

WSDL 1.1

full
fragment:

<portType name="ServicePortType"> <operation name="Ping"> <input message="s0:PingMessageIn"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="Ping"> <soap:operation soapAction="http://tempuri.org/ServicePortType/Ping" style="document" /> <input name="Ping"> <soap:body use="literal" /> </input> </operation> </binding>

WSDL 2.0

full
fragment:

<interface> <operation name="Ping" pattern="http://www.w3.org/@@@@/@@/wsdl/in-only"> <input element="s0:PingMessageIn"/> </operation> </interface> <!-- This is illegal as the SOAP binding is not defined for one-way meps --> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="http://www.w3.org/@@@@/@@/wsdl/soap" /> <wsa:UsingAddressing/> <operation ref="s0:Ping" /> </binding>

SOAP

full
fragment:

POST /Ping HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>Ping</wsa:Action> </soap:header> </soap:envelope> HTTP/1.1 202 Accepted Content-Length: 0

Note: the HTTP status code could be a 200, as specified by the ws-i Basic Profile and XML Protocol SOAP HTTP Binding.


Robust in-only

WSDL 1.1

Note: unsure whether a WSDL 2.0 MEP could be retrofitted into WSDL 1.1 via WS-A.

WSDL 2.0

n/a
fragment:

<interface name="ServiceInterface"> <operation name="EchoFault" pattern="http://www.w3.org/@@@@/@@/wsdl/robust-in-only"> <input element="s0:EchoFault"/> <outfault ref="s0:Fault"/> <!-- not currently defined..-> </interface> <!-- This is illegal as the SOAP binding is not defined for Robust-in-only mep --> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="http://www.w3.org/@@@@/@@/wsdl/soap" /> <wsa:UsingAddressing/> <operation ref="s0:EchoFault" /> </binding>

Robust in-only no FaultTo Fault generated

No FaultTo specified, fault generated

diagram

SOAP

full request full response
fragment:

POST /EchoFault HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoFault</wsa:Action> </soap:header> </soap:envelope> HTTP/1.1 500 <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://schemas.xmlsoap.org/ws/2004/03/addressing/fault </wsa:Action> </soap:header> <soap:Body> <soap:Fault/> </soap:Body> </soap:envelope>

Robust in-only no FaultTo no Fault generated

No FaultTo specified, no fault generated

diagram

SOAP

full request full response
fragment:

POST /EchoFault HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoFault</wsa:Action> </soap:header> </soap:envelope> HTTP/1.1 200

Robust in-only FaultTo

FaultTo specified.

Note: the previous scenario showing a fault on the return path is allowed when a FaultTo is specified. The messages flows in this pattern and the previous are valid. Is there an issue for the sender to know when it gets an HTTP 500 whether FaultTo still could be used?

diagram

SOAP

full request full response
fragment:

POST /EchoFault HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoFault</wsa:Action> <wsa:FaultTo> <wsa:Address>http://example.com/Fault</wsa:Address> <wsa:ReferenceParameters> <rp:CustomerKey xmlns:rp="http://tempuri.org/ReferenceParameters/Headers">ABCDEF</rp:CustomerKey> </wsa:ReferenceParameters> </wsa:FaultTo> </soap:header> </soap:envelope> HTTP/1.1 202 OK POST /Fault HTTP/1.1 <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://schemas.xmlsoap.org/ws/2004/03/addressing/fault</wsa:Action> <rp:CustomerKey xmlns:rp="http://tempuri.org/ReferenceParameters/Headers" wsa:isReferenceParameter='true'> ABCDEF </rp:CustomerKey> </soap:header> <soap:Body> <soap:Fault/> </soap:Body> </soap:envelope> HTTP/1.1 202 OK

In-out

WSDL 1.1

full
fragment:

<portType name="ServicePortType> <operation name="EchoStrong"> <input message="s0:EchoStringMessageIn"/> <output message="s0:EchoStringMessageOut"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="EchoString"> <soap:operation soapAction="http://tempuri.org/ServicePortType/EchoString" style="document" /> <input name="EchoString"> <soap:body use="literal" /> </input> <output name="EchoStringResponse"> <soap:body use="literal" /> </output> </operation> </binding>

WSDL 2.0

full
fragment:

<interface name="ServiceEnterface"> <operation name="EchoString" pattern="http://www.w3.org/@@@@/@@/wsdl/in-out">> <input element="s0:EchoStringMessageIn"/> <output element="s0:EchoStringMessageOut"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="http://www.w3.org/@@@@/@@/wsdl/soap" /> <wsa:UsingAddressing/> <operation ref="s0:EchoString" /> </binding>

In-out ReplyTo=Anonymous

Anonymous ReplyTo.

diagram

SOAP

full request full response
fragment:

POST /EchoString HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoString</wsa:Action> <wsa:ReplyTo> <wsa:Address>http://www.w3.org/2005/03/addressing/role/anonymous</wsa:Address> </wsa:ReplyTo> </soap:header> </soap:envelope> HTTP/1.1 200 Accepted <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoStringResponse</wsa:Action> </soap:header> </soap:envelope>

In-out ReplyTo

ReplyTo contains value.

Note this completely overrides the WSDL definition for soap bindings, as the WSDL says 1 soap request response mep is used with 1 HTTP protocol message.

diagram

SOAP

full request full response
fragment:

POST /EchoString HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoString</wsa:Action> <wsa:ReplyTo> <wsa:Address>http://example.com/Echo</wsa:Address> </wsa:ReplyTo> </soap:header> </soap:envelope> HTTP/1.1 202 Accepted POST /Echo HTTP 1.1 <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoStringResponse</wsa:Action> </soap:header> </soap:envelope> HTTP/1.1 202 Accepted

SOAP Fault generated. A fault is generated, perhaps before the ReplyTo or FaultTo is parsed.

full n/a
fragment:

POST /EchoString HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoString</wsa:Action> <wsa:ReplyTo> <wsa:Address>http://example.com/Echo</wsa:Address> </wsa:ReplyTo> </soap:header> </soap:envelope> HTTP/1.1 500 <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://schemas.xmlsoap.org/ws/2004/03/addressing/fault</wsa:Action> </soap:header> <soap:Body> <soap:Fault/> </soap:Body> </soap:envelope>

Appendix

Contains informative and more complex scenarios.

Protocol switch from Two-way to One-way and ReplyTo

Two different protocols are used and the ReplyTo contains value.

Note this completely overrides the WSDL definition for soap bindings, as the WSDL says 1 soap request response mep is used with 1 HTTP protocol message.

WSDL 1.1

full n/a
fragment:

<portType name="ServicePortType> <operation name="EchoStrong"> <input message="s0:EchoStringMessageIn"/> <output message="s0:EchoStringMessageOut"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="EchoString"> <soap:operation soapAction="http://tempuri.org/ServicePortType/EchoString" style="document" /> <input name="EchoString"> <soap:body use="literal" /> </input> <output name="EchoStringResponse"> <soap:body use="literal" /> </output> </operation> </binding>

WSDL 2.0

full n/a
fragment:

<interface name="ServiceEnterface"> <operation name="EchoString" pattern="http://www.w3.org/@@@@/@@/wsdl/in-out">> <input element="s0:EchoStringMessageIn"/> <output element="s0:EchoStringMessageOut"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="http://www.w3.org/@@@@/@@/wsdl/soap" /> <wsa:UsingAddressing/> <operation ref="s0:EchoString" /> </binding>

SOAP

full request full response
fragment:

POST /EchoString HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoString</wsa:Action> <wsa:ReplyTo> <wsa:Address>mythical-oneway://example.com/Reply</wsa:Address> </wsa:ReplyTo> </soap:header> </soap:envelope> HTTP/1.1 202 Accepted send example.com /Reply <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoStringResponse</wsa:Action> </soap:header> </soap:envelope>

Polling for response

I need more input on this. Some questions:

  1. Is this legal? In particular, the soap request-response mep says that upon a 3xx go back to init state which means an HTTP POST must be used. Is it legal to switch from a request-response to soap-response mep?
  2. I assumed an extension element (wspoll:onemep) to indicate one way wsdl mep, but should one or two WSDL meps be used?

WSDL 1.1

full n/a
fragment:

<portType name="ServicePortType> <operation name="EchoStrong"> <input message="s0:EchoStringMessageIn"/> <output message="s0:EchoStringMessageOut"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <wspoll:onemep/> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="EchoString"> <soap:operation soapAction="http://tempuri.org/ServicePortType/EchoString" style="document" /> <input name="EchoString"> <soap:body use="literal" /> </input> <output name="EchoStringResponse"> <soap:body use="literal" /> </output> </operation> </binding>

WSDL 2.0

full n/a
fragment:

<interface name="ServiceEnterface"> <operation name="EchoString" pattern="http://www.w3.org/@@@@/@@/wsdl/in-out">> <input element="s0:EchoStringMessageIn"/> <output element="s0:EchoStringMessageOut"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="http://www.w3.org/@@@@/@@/wsdl/soap" /> <wsa:UsingAddressing/> <wspoll:onemep/> <operation ref="s0:EchoString" /> </binding>

SOAP

full n/a.
fragment:

POST /EchoString HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoString</wsa:Action> </soap:header> </soap:envelope> HTTP/1.1 300 Redirect Content-Location http://example.com/EchoStringResource GET /EchoStringResource HTTP/1.1 HTTP/1.1 200 OK GET /EchoStringResource HTTP/1.1 HTTP/1.1 200 OK <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/anotheruniquestring</wsa:MessageID> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:Action>http://tempuri.org/ServicePortType/EchoStringResult</wsa:Action> </soap:header> </soap:envelope>

Two-way protocol where response contains request (aka Reverse HTTP)

I need more input on this. Some questions:

  1. What is the wsa:Action for the first message?
  2. How is the binding specified?
  3. Can the last message contain another request (ie pipelined)?
WSDL 1.1

full n/a
fragment:

<portType name="ServicePortType> <operation name="EchoStrong"> <input message="s0:EchoStringMessageIn"/> <output message="s0:EchoStringMessageOut"/> </operation> </portType> <binding name="ServiceBinding" type="s0:ServicePortType"> <wsa:UsingAddressing/> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="EchoString"> <soap:operation soapAction="http://tempuri.org/ServicePortType/EchoString" style="document" /> <input name="EchoString"> <soap:body use="literal" /> </input> <output name="EchoStringResponse"> <soap:body use="literal" /> </output> </operation> </binding>

WSDL 2.0

full
fragment:

<interface name="ServiceEnterface"> <operation name="EchoString" pattern="http://www.w3.org/@@@@/@@/wsdl/in-out">> <input element="s0:EchoStringMessageIn"/> <output element="s0:EchoStringMessageOut"/> </operation> </interface> <binding name="ServiceBinding" interface="s0:ServiceInterface" type="http://www.w3.org/@@@@/@@/wsdl/soap" /> <wsa:UsingAddressing/> <operation ref="s0:EchoString" /> </binding>

In-out ReplyTo=Anonymous on first message

Anonymous ReplyTo on first message, then ReplyTo contains value on second message.

diagram

SOAP

fragment:

POST /getRequest HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/someuniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/getRequest</wsa:Action> <!-- this has to be changed --> <wsa:ReplyTo> <wsa:Address>http://www.w3.org/2005/03/addressing/role/anonymous</wsa:Address> </wsa:ReplyTo> </soap:header> </soap:envelope> HTTP/1.1 200 Accepted <soap:envelope> <soap:header> <wsa:RelatesTo>http://example.com/someuniquestring</wsa:RelatesTo> <wsa:MessageID>http://example.com/someotheruniquestring</wsa:MessageID> <wsa:Action>http://tempuri.org/ServicePortType/EchoString</wsa:Action> <wsa:ReplyTo> <wsa:Address>http://example.com/EchoResult</wsa:Address> </wsa:ReplyTo> </soap:header> </soap:envelope> POST /EchoResult HTTP/1.1 <soap:envelope> <soap:header> <wsa:MessageID>http://example.com/yetanotheruniquestring</wsa:MessageID> <wsa:RelatesTo>http://example.com/someotheruniquestring</wsa:RelatesTo> <wsa:Action>http://tempuri.org/ServicePortType/EchoStringResult</wsa:Action> </soap:header> </soap:envelope> HTTP/1.1 202 OK