You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Glen Mazza <gl...@verizon.net> on 2008/02/16 14:49:25 UTC

wrapper vs. non-wrapper style confusion

Team,

Some questions:

1.)  According to the JAX-WS 2.1 Spec of May 2007, Section 2.3.1.1 and
2.3.1.2, for the following web service (from Figure 2.2):

<operation name="setLastTradePrice">
    <!-- input contains ticker symbol and last trade price elements -->
    <input message="tns:setLastTradePrice"/>
    <output message="tns:setLastTradePriceResponse"/>
</operation>

This is non-wrapper style mapping:
SetLastTradePriceResponse setLastTradePrice(SetLastTradePrice
setLastTradePrice);

This is wrapper style mapping:
void setLastTradePrice(String tickerSymbol, float lastTradePrice);

Is it just me, or does this seem highly counterintuitive?  I would say
the "wrapper" style uses one object to hold (or wrap) all the input
elements constituting the request, while the "non-wrapper" (i.e.
unwrapped) style would provide separate Java parameters for each part of
the SOAP request.  

2.) The wrapper / non-wrapper style above is a separate concept that is
unrelated to 
@javax.jws.SOAPBinding(parameterStyle.WRAPPED) and 
@javax.jws.SOAPBinding(parameterStyle.BARE), correct?

3.) If (2) is "Yes":  I think our WSDL2Java page[1] may have some
confusing phrasing here:

Text:
Q: My WSDL is in wrapped style, but how can I generate the bare style
code?

A: You can customize the WSDL with the following binding file:

<jaxws:bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    wsdlLocation="your.wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws"
    xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
    <enableWrapperStyle>false</enableWrapperStyle>
</jaxws:bindings>


I think the question should be phrased as:  "My WSDL is in wrapper
style, but how can I generate the non-wrapper style code?"

AFAICT, the term "bare" has nothing to do with <enableWrapperStyle/>,
it's an unrelated concept.

I'll add more clarification to the Wiki page here as soon as I
understand things better.

Thanks,
Glen