A Technology Blog About Code Development, Architecture, Operating System, Hardware, Tips and Tutorials for Developers.

Monday, November 19, 2012

RPC-style vs Document-Style Web Service

9:42:00 PM Posted by Satish Kumar , , 1 comment

There has been lot of confusion on which style of web service to use and why It is always recommended to use a Document-style webservice for SOA applications. Lot of people ask me what is the diffrence between RPC and Document style and why they always use Document style. So I am here to explian that.

RPC style web service:

These web services are easier to create and are usually synchronous in nature. The responsibility of marshalling and de marshalling lays with SOAP engine, This leads to significant performance degradations when message passed to an operation is large or complex. Since large sized messages lead to performance degradation in RPC style web service. 

Document style web service:

Document style web services are more time consuming to create, as it is the onus of the service to create the required objects from XML document. These web services can consume large sized documents without any significant drop in performance as there are no overheads of marshalling and de marshalling associated with SOAP engine. Document style web service are primarily used for implementing asynchronous service.

RPC encoded web services are easiest  create but offers least control in terms of usage of custom data types, validation and interoperability.

RPC encoded web service are slower in performance because of added overheads of marshalling and un marshalling.

Document literal web services are harder to create but scores higher in all the above.

Document style web services are better suited for defining custom data types as they are not constrained by the usage of a particular encoding style. Document –literal web services offers the best performance and RPC –encoded web services offers the least performance as in document-literal web service overheads of marshalling and un marshalling no longer lies with SOAP engine. In a document –literal web service alternative techniques such as  SAX based parsing or custom data binding tool like XML beans, castor can be used.In case SOAP engine does not maintain state a document –literal web service can be used to carry state related data in the document. While using RPC –encoded web service often platform specific data structures are exposed in WSDL, which might not be supported by other platforms.

1 comment:

  1. wow that is a really great information i just love to read this sort of knowledgeable info check this one bestkreative thanks for sharing..

    ReplyDelete