MEST is already omni-present, if you look for it

Dilip pointed me to recent posts from Savas and Jim about “message transfer”, or MEST. It's an interesting idea and I told him I'd post my thoughts (sorry for the delay Dilip :-).

As far as I can tell, the basic idea behind MEST is that web services developers should be thinking about message passing instead of RPC calls. I completely agree. But I disagree with the idea that that means there should be one WSDL interface with one operation “ProcessMessage”. There's no need to go there, because we're there already.

WSDL 1.1 has four generic message exchange patterns (MEPs), only two of which have meaning over HTTP: request/response and oneway. Request/response means “process this message and send me a response” and oneway means “process this message and don't send me a response”. When you write a WSDL portType definition, you're really creating a named list of named MEPs. Each named MEP (or operation) “instantiates” one of the generic MEPs by providing input and output elements (via the useless WSDL message construct). This information is useful, because it tells you the specific messages that a service will process and in the case of request/response MEPs, the message it will return.

The trouble starts when toolkits generate service and client code from a WSDL description. Most of them generate a class with a bunch of method calls. Each method call has multiple arguments that correspond to the sub-pieces of the message. This definitely pushes developers to think of Web services as just another RPC mechanism, which they aren't. It's important to note, however, that this is a toolkit, code-gen issue, not a WSDL design issue. Moving to a single generic ProcessMessage operation is a way to work around the misdirected path most toolkits take. There are other approaches that will achieve the same goal, however, and don't require convincing everyone that they should write their WSDL portTypes that way (which isn't going to happen).

One simple step is to map an entire input or output message to an argument. In this model, you still use classes with methods, but they take a single input argument representing the request message and optionally return a single argument representing the response message. You can do this with ASMX by defining wrapped messages (where there is an outer-most element the conveys the message's intent, e.g., “CheckPrice“) in your contract but programming with them as bare messages. The dispatcher will map each message to one arg instead of pulling them apart.

That model is okay, but still looks like method calls, albeit ones that see entire messages as first-class arguments. If that isn't enough you can use the lower level messaging API in WSE2 (which, in case I've never said, is IMHO the best WS toolkit shipping today!). The SoapClient/SoapService classes provide a cleaner implementation of the wrapped/bare trick in ASMX - operations map to methods that take a single input argument and return an optional argument. Arguments always represent entire messages. You can go even deeper, though. First, you can use SoapClient generically without a type-safe proxy by deriving a generic proxy type that calls SoapClient's invoke methods passing an action URI and a message. That's the client side of “ProcessMessage”, no matter what the WSDL says. You can also use SoapSender and SoapReceiver to build whatever programming model you want - async, event based, method calls, or any mix.

So, while I'm behind the MEST, I'm not behind the argument that there should be only one ProcessMessage operation in your WSDL portType. We don't need to go there because that abstraction already exists further down in the stack. The right way to get where MEST wants to go is to focus on popularizing alternative programming models, perhaps by building something really slick on WSE2 or Indigo (if it isn't there already).


Posted Feb 10 2005, 08:19 AM by tim-ewald

Comments

Savas Parastatidis wrote re: MEST is already omni-present, if you look for it
on 02-10-2005 6:39 AM
Hey Tim!!! I am afraid you misunderstood (it's my fault for not making it very clear). MEST does not propose a single operation defined in WSDL called ProcessMessage. Far from it!!! We promote the idea that the only single truth in service-orientation is the exchange/transfer of messages. However, we noticed that many couldn't abstract away from the concept of an operation and so we decided to describe service-orientation, where messages and services are the only true abstractions, in terms of a "logical" operation called "ProcessMessage". Please note that i am talking about service-orientation (the architectural model) and not WS (the implementation technology).

This operation is implicitly implemented today by HTTP POST, tcp send/receive, SMTP DATA, etc. We wanted to give uniform semantics to such an abstraction that could be used to describe architectures.

So, "ProcessMessage"=="one-way message and a request to process that message". Using this simple abstraction one can describe the architecture of a system in terms of messages. Once you accept that all services support this abstraction you can move to one level up and describe how the messages exchanged can be combined into interesting MEPs (more complex than the WSDL request/response), which we call protocols. Protocols capture behaviour and that behaviour is described in the service's contract.

And, yes, we have moved on and done a lot of work on this idea and we even have some WSE-based implementation. Once that work is made available for public comments (we hope in few days), then we can come back to MEST and try to describe it better (hopefully we'll do a better job than what we've been doing to-date).

I hope i haven't confused you with this short note. Let me emphasise again that the last thing we are proposing is a WSDL document with a single operation called "ProcessMessage" defined.

If you are interested, I can give you access to some of the stuff we are preparing. We'd be very very interested in your feedback and I suspect that you are going to like it a lot (well... i hope:-)

Regards,
.savas.
<savas:blog /> wrote Tim Ewald on MEST
on 02-10-2005 6:56 AM
Tim has some comments on MEST. While I said that I am not going to try and describe MEST again until we have a paper written, I think I need to make a clarification (some more details can be found as a comment on Tim's post).As I've said previously, M...
SOAphisticated wrote Savas tells me I misunderstood MEST
on 02-10-2005 10:53 AM
Brian Glaser wrote re: MEST is already omni-present, if you look for it
on 02-12-2005 5:33 AM
Seems to me and a few others that although the ProcessMessage abstraction is adequate to architect around, the pub-sub abstraction is better and already has a strong foundation in the industry. As with MEST, we're not talking about physical operations that map, for example, to JMS or MQSeries, but a logical subscribe operation, where services that can receive messages subscribe to the "ether"-bus, and likewise a logical publish operation, where services that want to send messages put them onto the "ether"-bus.

Brian.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?