W3C home > Mailing lists > Public > www-ws-desc@w3.org > October 2004

On the Operation Name Mapping requirement

From: Savas Parastatidis <Savas.Parastatidis@newcastle.ac.uk>
Date: Mon, 4 Oct 2004 12:51:16 +0100
Message-ID: <37E80E80B681A24B8F768D607373CA80014BB4BB@largo.campus.ncl.ac.uk>
To: <www-ws-desc@w3.org>

Dear all,

Jim Webber and I are trying to get our heads around the Operation Name
Mapping (ONM) that exists in the current draft at the interface level
but will be moving to the service level, as I read in one of the
threads, in the next draft. 

We have been working on a very simple Noughts-and-Crosses (tic-tac-toc)
example for using SOAP and WSDL. The two players are effectively two
services exchanging messages. The description of each of the services
has to be symmetric, if we are to reason about their ability to
meaningfully exchange messages. This means that we have to describe both
the "initiating" and the "reacting" message exchanges. Here's what I
mean...

<definitions targetNamespace="nac:interfaces:initiator">
  <interface name="Player">
    <operation name="GameOver"
pattern="http://www.w3.org/2004/08/wsdl/out-in">
      <output element="nac:game-over" />
      <input element="nac:game-over" />
    </operation>
  </interface>
</definitions>

<definitions targetNamespace="nac:interfaces:reactor">
<interface name="Player">
  <operation name="GameOver"
pattern="http://www.w3.org/2004/08/wsdl/in-out">
    <input element="nac:game-over" />
    <output element="nac:game-over" />
  </operation>
</interface>

A Web Service that supports both these roles is described as:

<interface name="Player" extends="initiator:Player reactor:Player" />

What do the above interfaces mean? The first one tells us that the
service at some point will send a <game-over> message and will expect to
receive a corresponding <game-over> message as a result. The second
interface tells us that if a service receives a <game-over> message, it
will respond with the same message. It's just happens that the logic of
the services requires that the messages are the same. 

Since we are in a loosely coupled world, we don't really know which of
the two players will send the <game-over> message first, so we need to
support both behaviours at each service. This is absolutely fine since
the logic of the two services can cope with the scenario. "Oh... I just
received a 'game-over' message. The other player is telling me
something. I have to reply accordingly". Or, "Oh... I just received a
'game-over' message as a reply to the one I previously sent. That's the
other player's response". And "what if both endpoints send the same
message, at the same time?" you ask. Well, we use WS-Addressing to cope
with this situation ("ReplyTo" header).


However, the ONM requirement doesn't allow our services to be described
in this way since the wire format is the same for both GameOver
operations. The service logic requires us to send messages <game-over>
messages on the wire (and this works in our implementation) but WSDL 2.0
doesn't allow us to describe it. Should WSDL be so restrictive and
direct us towards a particular way of describing our services?

We can think of other business cases where it is the service logic that
determines the dispatching of a particular operation (based on contents,
protocol, etc.) and not the uniqueness of the wire format.

We'd be interested in the WG's comments.

Regards,
Savas & Jim
Received on Monday, 4 October 2004 11:51:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:33 GMT