service's processing model
may be business
object (or method) centric
or it may be
. The business
is driven by a series of method calls. These method calls apply the business logic of the service to a set of business objects containing the information required for processing the request. Anexample of an object-centric service might be a
credit card authorization
Web service.Such a service may receive the credit card details as parameters with the method calls.
The methods invoked on the service map directly to specific business logic.
method parameters are used to map to a particular business object (such as asession or entity object) or they are used to pass data to the business logic
document-centric Web service
business logic is kept separate from thedocument content
. The service receives an XML document, and that document containsonly data and no explicit binding to the business logic that is to be applied. There is nomapping of the request to the business logic; that is, specific methods are not invoked onthe service. Instead, the Web service applies its business logic to the XML document, andthe document content determines the processing workflow. A travel agency Web serviceis a good example of a document-centric service. The service receives a request: an XMLdocument that contains the details of the desired travel itinerary -- dates, places to visit, preferred accommodations, and so forth. The travel agency service processes the requestaccording to the document content.
The interaction model encompasses the client's interaction with the Web service.
Aclient's interaction with a Web service can be
synchronous or asynchronous
, or acombination of both types of communication. (That is, some method invocations may besynchronous and others may be asynchronous.) When a synchronous model is followed,the application typically uses an RPC-oriented interaction. With this type of interaction,the client's request is mapped to a method call on the Web service's business logic on theserver. Using the credit card service as an example, the client utilizes an RPC call toinvoke a method on the credit card service's server. The client passes the method thecredit card details as an argument. The client might invoke a method to authorize use of the credit card and
pass the method an object containing the card details
, such as byinvoking the method
is usually associated with an
communication. The client's request is sent as a message. The Web service receives themessage and processes it, sending the results when it completes its processing. In the caseof the travel agency service, the details of the client's travel request are sent to the serviceas an XML document via a message (or as an attachment to an RPC call). The servicereceives the document and parses it to determine how to process the request.
The RPC-oriented and document-oriented Web services form two ends of aspectrum.
At one end, a Web service may use a totally RPC-oriented interaction modeland object-centric processing, in which case you model it as a RPC-oriented Web service.At the other end, a service may be completely document oriented and communicate withasynchronous messaging.