9.2 Document style Web services

 < Day Day Up > 

9.2 Document style Web services

While our discussion of Web service implementation has so far been based on the RPC communication style, the SOAP and WSDL specifications allow for another kind of Web service binding style: the document style.

Document style Web services are document-driven and more loosely coupled than RPC style Web service. RPC style assumes that the provider is a procedure, and the call to the service is a remote procedure call, where the requester provides the call parameters in the SOAP body. The call parameters are wrapped in an element that specifies the procedure's name. The document style makes no assumptions about how the provider will process the service call, which leaves more flexibility in the definition of the messages consumed by and produced by the service.

Advantages of document style include:

  • Document style is more naturally suited to asynchronous processing and one-way scenarios.

  • Changes to the message schema are less likely to break service consumers. Adding elements to messages, and reordering sequences in message definitions, are less likely to impact both consumers and providers.

  • It is possible to add information to the XML document that is being exchanged between the consumer and provider for purposes other than the invocation of the service. In the RPC style, the message must be validated in order to invoke the target procedure. With document style, validation of additional elements can be deferred to a component of the implemented service.

  • Microsoft tools for the creation of Web services tend to use the document style, so interoperability with service providers or requesters built for compatibility with Microsoft platforms is more likely.

  • Document style services tend to perform better than RPC style services. This is because the SOAP server has to perform validation with RPC style, whereas for document style the XML request is sent straight to the processing application.

Disadvantages of document style include:

  • It is more complex to write and provide services for document style. RPC services are more rigid in the message formats they use, and therefore less parsing and message analysis code is required in the application code than with document style, which may have to cater for more data and more combinations of document structure.

  • Development tool support for document style Web services has not been strong. WebSphere Studio Application Developer V5.1 and WebSphere Application Server V5.0.2 provide new development and deployment tools supporting document style Web services.

A detailed discussion of the merits of document style is available from:

  • http://www.ibm.com/developerworks/webservices/library/ws-docstyle.html

  • http://www.ibm.com/developerworks/webservices/library/ws-castor

 < Day Day Up > 

Patterns Direct Connections for Intra- And Inter-Enterprise. Direct Connections for Intra- And Inter-Enterprise (IBM Redbook) (Paperback)
Patterns Direct Connections for Intra- And Inter-Enterprise. Direct Connections for Intra- And Inter-Enterprise (IBM Redbook) (Paperback)
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net