Welcome!

SOA & WOA Authors: Roger Strukhoff, Elizabeth White, Mark Cravotta, Jason Bloomberg, Liz McMillan

Related Topics: SOA & WOA

SOA & WOA: Article

Get the Message

Get the Message

Back in the old days, when you needed to communicate with someone distant, you usually had to send a letter. There was no instant response, and there was no way to tell when your message was received. Now we have always-on e-mail, BlackBerrys, and assorted other devices to make what was once a leisurely (or agonizingly slow) process instantaneous, and synchronous.

This issue is about the battle of two idioms - instant, synchronous communication, as championed by the Remote Procedure Call; and asynchronous communication (which may still be instantaneous, but doesn't have to be), represented by the message-based camp.

Web services is about communication, plain and simple. Two (or even more) computers work together to accomplish a task, sometimes directed by human beings, sometimes working based on some program. To work together, the computers exchange information. Web services makes this easy by standardizing the approach to this communication.

But what isn't standardized, at least in theory, is how the communication takes place. That is to say, one approach is the default, but it is not the only allowed, or possible, approach.

By default, a Web service is synchronous. It's simplest to think of it in that sense because an RPC is a very simple concept and the coordination of the interaction is very easy to understand. You simply connect to the service, invoke it, then wait for the response, which you normally would expect instantaneously, or nearly so.

This works well for some things, especially if you expect that the service can provide a quick response. But for other types of applications, particularly ones in which human interaction or workflow might be involved, they are less appropriate. Especially bad is the situation where multiple parties have to be coordinated.

Consider an example where a service might have to arrange for shipping, insurance, bills of lading, even letters of credit. Many parties need to be coordinated here, and not all will be able to respond in a synchronous fashion. In this case, instead of a function call what we really need is to create a conversation.

Of course modeling such a service is inherently more complex. Leaving out the transport mechanisms and callback models for the time being, just drawing a flowchart of such a process might result in pages of lines and boxes, choices and exceptions. And yet, given the nature of the transaction, the complexity is a part of the actual conversation and can't be simplified.

Which brings us back to the reason that Web services doesn't specify how the information needs to be delivered - so that we can define a service, and then define the protocol over which it communicates. We can, for example, use SMTP to move messages over e-mail channels, or use JMS in the Java world to communicate (assuming all the firewalls will cooperate), or use a more generic solution such as Tibco or MQ Series. Other options are possible too.

But with this flexibility comes a bit more complexity as well. With message-based Web services, we have to devote more thought to what exactly a service, or transaction, is, and how we will know when it is over, and whether it succeeds. These issues are not as important in the RPC world because the transaction is (usually) a single synchronous invocation and as soon as we get the response from the remote system we have the answer. Unfortunately the standards for transaction management, as well as workflow (or business process management), are still evolving, so it will be confusing for a while.

But it's good to have choices. And even now, things that appear synchronous aren't always what they seem. Ask anyone who has my instant messaging address - see if they believe instant messaging is "instant." I can assure you, it isn't.

And the reality is, there is room, and a need for both programming paradigms within Web services. This issue explores those two approaches in depth. Now it's time for me to ignore some instant messages…

More Stories By Sean Rhody

Sean Rhody is the founding-editor (1999) and editor-in-chief of SOA World Magazine. He is a respected industry expert on SOA and Web Services and a consultant with a leading consulting services company. Most recently, Sean served as the tech chair of SOA World Conference & Expo 2007 East.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.