This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes RPC vs Document/Literal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "RPC vs Document/Literal" Watch "RPC vs Document/Literal" New topic
Author

RPC vs Document/Literal

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Hi All,

I googled and understood some concepts regarding the above approach. Can anyone tell me if I am right or wrong?

1). RPC approach

-->Input and Output to the web service(In the soap request/response) is a method name and parameters.
-->Cannot validate the request to the web service

2).Document/Literal approach:

-->Input and Output to the web service are XML messages.
-->Can validate the SOAP Request with an XML Schema.

Thanks.


Be Humble... Be Nice.
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
I just want to make sure before I get into the testing stuff coz am a complete novice to this.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1167
Arjun,

The cheerful page Soap Fight: RPC vs. Document supports your summary.

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Thanks Dan for the link. I am just trying to find out if what I understood is correct. is it?/

Thanks.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
Originally posted by Arjun Reddy:
I am just trying to find out if what I understood is correct. is it?


You aren't quite there yet. Here are some nits
  • You can't compare RPC and Document/literal. You can compare messaging styles (RPC vs Document), encoding styles (encoding vs literal), or messaging modes (e.g. RPC/literal vs Document/literal)
  • "Cannot validate the request to the web service" - should most likely be Cannot validate message payloads with XML Schema. Document/literal payloads can be validated entirely through XML schema, RPC/literal payloads have to take the WSDL's message composition rules into account (so the validator would have to be WSDL aware), and the encoding of RPC/encoding is outside of the scope of XML Schema and WSDL.
  • You are not considering the the "Wrapped Document/literal" convention which describes an informal RPC-oriented payload document format that is fully validatable through XML. It's just not being that honest about being "RPC".


  • I've always found these useful:
    Which style of WSDL should I use?
    wrapped document/literal convention
     
    Don't get me started about those stupid light bulbs.
     
    subject: RPC vs Document/Literal
     
    Similar Threads
    document Vs rpc message styles
    Sample Questions for 288 - Need answers
    WSDL Style?
    JAX-RPC Client invoking Document based web service
    Axis RPC vs Document style web service