• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SOAP document/literal and rpc/literal explicitly in code

 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello rancher

I've been going over some tutorials on the web and some mentioned that it is possible to explicitly set whether the web service is document/literal or rpc/literal.





I understand that "document/literal" is the default but why specifying literal with RPC has that warning saying wrapped parameter style?

What's the WRAPPED parameter style in the first place?

Thanks
 
Ranch Hand
Posts: 47
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please go through wsdl chapter in Java Web Services Up and Running.
 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wrapped style means in the SOAP request message, there is an XML node with the operation name like this:

The parameter myname is wrapped by the operation name sayHello.

But in RPC BARE style, the operation <ns:sayHello> is omitted.

With wrapped style, the developer can tell what operation they are calling in the request. But with bare style, the developer cannot tell what operation they are calling.
If you use RPC, make sure no two methods have the same number and type of parameters.



But if you comment out one of the method ,you will get the SOAP request:


You will see with RPC BARE style, the parameters are not wrapped by its operation node.
Since there is no operation node in this style, the above eat and sayHello method cannot have the same number and type of parameter to avoid ambiguity.
That is why wrapped style is the default.

Also with document style, the SOAP request can have user defined parameters like this:





But with RPC, you can only use primitive parameters or string, no other object parameters.
 
reply
    Bookmark Topic Watch Topic
  • New Topic