• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOAP document/literal and rpc/literal explicitly in code

 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • 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
 
Deepa Sreedhara
Ranch Hand
Posts: 47
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please go through wsdl chapter in Java Web Services Up and Running.
 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic