Hello!
With Document/Literal encoding, the payload of a message is an XML fragment that can be validated against the corresponding XML schema, for instance:

RPC (remote procedure call)/Literal more closely corresponds to remote procedure invocations.
For instance, the method: public float getBookPrice(String inISBN) would correspond to the following RPC/Literal request message:

There is a SOAP standard XML format for RPC-style messaging. However, use and implementation of this standard is optional.
Hope this makes things more clear!

Mikhael Jenings
Greenhorn

Joined: Apr 14, 2009
Posts: 25

posted Apr 28, 2009 10:37:47

0

Thanks, that clarifies things a bit.

To further take things, what is the effect of choosing either mode on (java) code ?
How are the generated artifacts different, when we do wsdl-to-java ?

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198

1

posted Apr 28, 2009 19:05:08

1

Hello again!
When doing WSDL-to-Java, you will, in both cases, see JAXB generated wrapper classes for the request and response (and for any additional objects).
As far as I can tell, the only potential difference is the complexity of the JAXB bean hierarchy, as far as Document/Literal is concerned. However, the parameter(s) to a RPC invocation may also consist of an object hierarchy.
By looking only at the Java classes, I wouldn't dare to say that the web service uses either RPC/Literal or Document/Literal.

<IK:WARNING message="SECTION WITH PERSONAL OPINIONS AND WILD SPECULATIONS AHEAD!">
Personally, I feel that RPC/Literal and Document/Literal are just different ways of thinking about the request and response data being passe to, and received from, a web service. RPC/Literal seems, from all the examples and code I have seen, to be a special case of Document/Literal, following a certain pattern for creating request and response messages from the signature of the procedure/method that is to be invoked.
Perhaps this distinction made more sense when RPC/Encoded is taken into consideration, something that I will not do due to RPC/Encoded not being sanctioned by the WS-I Basic Profile.
Perhaps RPC/Literal is some kind of remains from the early days of web services, when, I imagine, people began with doing RPC invocations.
</IK:WARNING>
Best regards!

Mikhael Jenings
Greenhorn

Joined: Apr 14, 2009
Posts: 25

posted May 01, 2009 11:40:28

0

Thanks Ivan !!!

Helps while I get my head wrapped around this ;-)

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198

1

posted May 19, 2009 20:51:55

0

Hello!
After having come to new insights, I feel I need to update my earlier reply, which was not entirely clear on this point:
One important difference between RPC and Document web services is that with RPC web services, XML schema will only be created for complex type parameters. It is thus not possible to validate the entire XML fragment contained in the SOAP body.
With Document web services, however, the XML schema needs to define the ENTIRE XML fragment contained in the SOAP body. Consequently, the entire message can be validated against the XML schema.
Best wishes!