Skip to main content

Wrapper Mapping Style Issue

3 replies [Last post]
Joined: 2005-06-20

I've taken the fromwsdl example in the samples directory and compiled it. It seems to work as the AddNumbersPortType uses the wrapper style methods:

@WebResult(targetNamespace = "")
@RequestWrapper(className = "", localName = "addNumbers", targetNamespace = "")
@ResponseWrapper(className = "", localName = "addNumbersResponse", targetNamespace = "")
public int addNumbers(
@WebParam(name = "arg0", targetNamespace = "")
int arg0,
@WebParam(name = "arg1", targetNamespace = "")
int arg1)
throws AddNumbersFault_Exception

However, if I take the AddNumber.wsdl and try to copy the 'addNumbers' operation and create a "addNumbers2" operation that is defined identically with the first other than its method name:


If I run try to compile this modified wsdl, I see that 'addNumbers' is still wrapper style and my new 'addNumbers2' is non-wrapper style.

I've been trying to figure out why my code does not compile to wrapper style as I think it meets all the qualifications spelled out in the JAX-WS2.0 documentation. I think I narrowed it down as far as I can with the example above.

Where have I gone wrong?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-04-06

I've posted new topic that is related in part to this topic.
See also next.

Joined: 2005-06-20

I feel like a retard. After hours, of looking into this just minutes after publically asking, I figured it out. Although I don't really understand why is needed for enforcement: "The input message part refers to a global element declaration whose localname is equal to the operation name".

This means I have to create multiple addNumber elements (one named addNumbers2). But why can't we reuse elements here since they are identical?

Joined: 2003-06-16

The wrapper style mechanism was intended to create more friendly SEI's. However, without this kind of restriction,
almost all elements that are a complexType using xsd:sequece would be treated as wrapper style, and that is not always the case so we needed someway to distinguish between the two.