This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Axis RPC vs Document style web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis RPC vs Document style web service" Watch "Axis RPC vs Document style web service" New topic
Author

Axis RPC vs Document style web service

kalra kalra
Greenhorn

Joined: Jan 10, 2007
Posts: 2
As we know RPC style use soap encoding (Java <-> XML <-> Java) where as Dcoument style use literal encoding.

1.Can somene please explain me what's the difference between two

2. How does Dcoument style web service gives better performance

3. I have generated the wsdl(using axis) for both document and rpc style web service i.e. style="rpc" and style="document" in server-config.wsdd. I have noticed the difference the way it generates the soap messgae. In case of RPC, soap request message conatin operation name where as in case document style , soap request message does not contain operation name. this is the only difference I can figure it out

Does Axis do something different for document style web service i.e. in terms of serialization/deserialization, parsing etc so that document style web service do have better performance

Regards
Deepak
Tom George
Ranch Hand

Joined: Jan 28, 2004
Posts: 41
RPC makes sense when you want to convert an existing function to a web service call. Essentially you give provision to switch back and forth between java & xml to expose your methods for a web service call. This is usually the case when you migrate existing functionality as such to web services (which IMHO is a bad idea anyway !)

Document based services are used when you pack together a set of data as xml and send it over to the server, which does a set of functionality and give you back some data as xml. For example, add goods to inventory, update an order processing system, send mail etc (maybe as an asynchronous process) Here you are more concerned about grouping business rather than migrating your java functions as web services.

Performance improvements of one over the other? hmm.. none - if the same functionality involved is the same.

Folks, correct me if I'm wrong !!

kalra kalra
Greenhorn

Joined: Jan 10, 2007
Posts: 2
RPC style web service uses SOAP encoding whereas Document style web service use literal encoding.

In case of SOAP encoding each element in the SOAP body includes the XML Schema definition type of the data element.SOAP encoding with the embedded data types increases the amount of data transferred in the Web services request. Thus it increase the time to parse the data.

In case of Document encoding indicates that the rules to encode and interpret the SOAP Body are specified by a XML schema. THus each element does not contain data type. So payload size is less in this case
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Axis RPC vs Document style web service
 
Similar Threads
Question on WSDL
java.io.IOException: Type {http://lang.java}Exception is referenced but not defined.
Question on Asynchronous web service call using document style.
Apache Axis wsdl2java tool
How to determine if it is Document style or RPC looking at SOAP request ?