File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes RPC v Document style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "RPC v Document style" Watch "RPC v Document style" New topic

RPC v Document style

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Just reading through the excellent Ivan A Krizsan notes and the messaging modes RPC/Literal and Document/Literal style, he makes the point RPC is usually used to expose existing components as web services?

Why is this? Surely Document style could also be used?

Any comments?

Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Hi Luke,
he makes the point RPC is usually used to expose existing components as web services

This is because existing components might have been designed without keeping in mind of potential future exposure as web services, they might well contain "overloaded" methods. As typical RPC style SOAP message relies on dispatching SOAP message based on "method" name, it'd would confuse Web Service API to which method it should dispatch incoming input request.

On the otherhand, Document style SOAP message replies on "order and type" of the arguments to dispatch incoming input request. Unless you are sure existing code doesn't have overloaded methods, you shouldn't use this style to expose as Web Services. Note that "operation overloading" is already NOT allowed by WS Basic Profile 1.0.

(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
I just want to add that the latest version of my study notes can be found at:
The version on JavaRanch is not up to date.
Best wishes!

My free books and tutorials:
subject: RPC v Document style
jQuery in Action, 3rd edition