Web Services - Document vs. RPC Binding Style
Despite the architectural arguments for or against using document style across the board, the fact is that the WS-I has declared that both RPC-Literal and Document-Literal style Web Services are allowable for interoperability. In particular, you need to evaluate whether to use document style or RPC style messaging in your web services based on the details of the particular scenario you are implementing. While you want to be consistent in your processing model, you can achieve this by using either document and RPC style in a consistent way. You do not have to choose just one style throughout your business.

Some guidelines that can help you identify which mode to use in a particular scenario are:

* Some XML is intended to be treated as documents (for instance, consider a newsfeed). Document style should be used when the message payload is going to be processed as XML, for example, when it is to be transformed into another format and stored directly into a database or if the payload is going to be merged with other XML and then sent on to another destination.

* If your application already has XML interfaces, you will probably want to use document style. Likewise, if you are sending data conforming to an industry XML vocabulary, you will probably to want to use document style.

* When executing functions or sending data which will be analyzed, you need to carefully evaluate the choice between document and. RPC offers simplicity and sometimes better tooling support. Document offers greater flexibility and decoupling, and under some circumstances (large messages with many elements) vast reduction in message size, but may requires more XML expertise and hand coding.

However, despite that fact that both models have been accepted, the practical fact of the matter is that there have been fewer problems found when using document-literal style communications than RPC style. Thus, if you anticipate any interoperability with your services, it is advised that you plan on using the document-literal style for your Web Services. When doing so, be very cognizant of the limitations placed on what XML Schema elements can be understood by JAX-RPC and other vendor tool sets.

A good article discussing the various styles of WSDL can be found here.
2 Comments To ' Web Services - Document vs. RPC Binding Style '

Post a Comment