aspose file tools*
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
JavaRanch » Java Forums » Java » Web Services
Bookmark "RPC vs Document/Literal" Watch "RPC vs Document/Literal" New topic

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.


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: 1164

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


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?/

Peer Reynders

Joined: Aug 19, 2005
Posts: 2906
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 succumb to the false authority of a tool or model. There is no substitute for thinking."
    Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
    I agree. Here's the link:
    subject: RPC vs Document/Literal
    Similar Threads
    document Vs rpc message styles
    JAX-RPC Client invoking Document based web service
    Axis RPC vs Document style web service
    WSDL Style?
    Sample Questions for 288 - Need answers