In Case of Document Style webservice we dont pass the method name to be invoked in the SOAP request.If i have two methods in a webservice how does the server decides which method to call based on the SOAP request.
In document oriented web services the type of document determines the method of processing. In some cases the service inspects the contents of the document before it decides what to do with it. This is why document oriented web services are more loosely coupled than RPC-style web services - the service inherently knows what to do with the document. There is no need for the client to identify a method.
However that pattern is more appropriate when you need to submit multiple documents at once. The fact that you want to specify the method indicates that you want to superimpose RPC semantics on a document oriented web service which could be a sign of a flawed (document oriented) web service interface.
Document/literal is used in a document oriented web service - but it doesn't create a document oriented web service.
Peer, I am still not getting the point . Let me put it this way: I have a Doc/Literal web service with two methods and both the methods take the same argument data type. In the sense both the method takes an argument that complies to a single schema. So the SOAP request will be the same for both the methods.As the body element of SOAP complies to a single schema. So how does the server at the receiving end identifies which web service method to call? Hope i am clear!!
Originally posted by Venkatesh Rangamani: I have a Doc/Literal web service with two methods and both the methods take the same argument data type.
Exactly. This situation arises because your web service is RPC by design. Doc/Literal is for Document-Oriented web services where the 'Method' is either implied by the type of the document itself or by the content of the document (i.e. the service can inspect it and then decide what to do with).
Example: An RPC design may require two methods for a Purchase Order (PO), new(PO) and revise(PO). A document oriented web service would simply accept the PO - if it carries a known identifier the PO is sent to the revision process - if the identifier is new it is sent to the new PO process.
So if you are creating an RPC web service then use RPC/literal. If you are creating a document based Web service then use Document/literal.
There is one work around, the 'wrapped document pattern' that lets you do RPC things with the document/literal style - from a design perspective this is a bad idea. Essentially you define a different envelope document for each method that you wish to express and then you stuff your document into these envelopes.
So rather than simply handing your PO to the clerk (who doesn't want to bother with figuring out whether this pertains to an already existing PO) for processing, you are now required to put new POs in a blue envelope, while revised POs go into a yellow envelope ....
Peer, I understand what you are trying to say!! you are trying to say from a design perspective. But what my doubt is, assuming that i have two such methods how does the server identifies which method to call based on the SOAP message.
Document/literal doesn't have a method because of the way document oriented web services operate. Hence the "Wrapped Document Pattern" workaround for RPC type interactions. See Which style of WSDL should I use?.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop