File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes ParameterStyle.WRAPPED vs ParameterStyle.BARE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "ParameterStyle.WRAPPED vs ParameterStyle.BARE" Watch "ParameterStyle.WRAPPED vs ParameterStyle.BARE" New topic

ParameterStyle.WRAPPED vs ParameterStyle.BARE

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 1115
Can someone explain to me the difference between ParameterStyle.WRAPPED vs ParameterStyle.RPC in this case ?
The SOAP request is the same in both cases.

Jurica Krizanic
Ranch Hand

Joined: Dec 11, 2008
Posts: 38

Himai Minh wrote:Can someone explain to me the difference between ParameterStyle.WRAPPED vs ParameterStyle.RPC in this case ?]

You mean ParameterStyle.WRAPPED vs ParameterStyle.BARE?

Jurica Krizanic - Java developer, OCPJP6, Spring Core certified developer!
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 1115
From MZ's notes, I used the example and create three cases:
Case 1:

Case 2:

Case 3:
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1341

//Why rpc/wrapped generated the same SOAP as doc/wrapped ?

It is because we have asked it to do so.
Using Parameter style as WRAPPED has wrapped parameter with operation name tag.

Normally in text books, we show Parameter Style as WRAPPED or BARE with Document type only.
document/literal wrapped combination is same as document/literal, but wraps the contents of the body in an element with the same name as
the web service method (just like RPC-style messages). This is what web services implemented in Java use by default.

Point to understand that RPC binding can also have WRAPPED parameter style. Infact, WRAPPED parameter is the default and only allowed
parameter style that we can use with RPC. Parameter style BARE is not allowed with RPC. That's way, in text books, RPC style is not shown associated to WRAPPED style.

For example -

We get error as

There are 3 attribute that you can specify with SOAPBinding.
a. style - this attribute defines the binding type - RPC or Document
b. use - Specifies how the data of the SOAP message is streamed and recognised/validated. For example- Literal means that the SOAP body follows an XML schema
, which is included in the web service's WSDL document. As long as the client has access to the WSDL, it knows exactly how each message is formatted.
This paramter can be LITERAL or ENCODED.
c. parameterStyle - Specifies how the method parameters, which correspond to message parts in a WSDL contract, are placed into the SOAP message body.
A parameter style of BARE means that each parameter is placed into the message body as a child element of the message root.
A parameter style of WRAPPED means that all of the input parameters are wrapped into a single element on a request message and that all of
the output parameters are wrapped into a single element in the response message.

Oracle certified Java 8 Programmer I (1Z0-808), Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I, CIW Certified Ecommerce specialist
I agree. Here's the link:
subject: ParameterStyle.WRAPPED vs ParameterStyle.BARE
It's not a secret anymore!