Meaningless Drivel is fun!
The moose likes Web Services and the fly likes Difference between Message and RPC based Web Services ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Difference between Message and RPC based Web Services ?" Watch "Difference between Message and RPC based Web Services ?" New topic

Difference between Message and RPC based Web Services ?

Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
What is the difference between Message and RPC based Web Services ?
Richard Monson-Haefel
Ranch Hand

Joined: Oct 31, 2003
Posts: 92
Well, that's become kind of difficult to answer, but in general an document service exchanges, well XML documents. An RPC service exchange parameterized values. So if you have a complex purchase order you want to deliver from one endpoint to another, you'll probably want to use document. If you want invoke a service with a limited amount of input and output, than you may want to use RPC. DON'T USE RPC/ENCODED. It doesn't work well. Stick with Document/Literal or RPC/Literal - these concepts are explained in more detail in my and other peoples books.
A lot of people equate RPC and Document messaging as synonymous with request/reply and asynchronous messaging respectively. Don't make the same mistake. Document and RPC refers to the packaging of the payload, not the interaction of the communicating parties. You can do RPC as request/reply or async and you do Document as async or request/reply.
In reality, today everyone is using HTTP for web services, which is a request/reply protocol, but a reply can just be a simple "message received" reply, which doesn't contain any data. In other words, the fact that HTTP is actually request/reply doesn't mean it can't be used as the underlying protocol for asynchronous messaging. This is probably more confusing than helpful, but it how these things work. Did you know that most MOM products use a request/reply protocol under the asynchronous semantics of the programming model? The request/reply is used to confirm that the message broker received the message - other wise you wouldn't have any idea if it was sent successfully or not.

-- <br />Richard Monson-Haefel<br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Difference between Message and RPC based Web Services ?
It's not a secret anymore!