Skip to main content

Wrapper Mapping Style Issue

3 replies [Last post]
dhunter21
Offline
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:

@WebMethod
@WebResult(targetNamespace = "http://duke.org")
@RequestWrapper(className = "com.acme.foo.AddNumbers", localName = "addNumbers", targetNamespace = "http://duke.org")
@ResponseWrapper(className = "com.acme.foo.AddNumbersResponse", localName = "addNumbersResponse", targetNamespace = "http://duke.org")
public int addNumbers(
@WebParam(name = "arg0", targetNamespace = "http://duke.org")
int arg0,
@WebParam(name = "arg1", targetNamespace = "http://duke.org")
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?

Thanks

Reply viewing options

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

I've posted new topic that is related in part to this topic.
See also next.
http://forums.java.net/jive/thread.jspa?threadID=17837

dhunter21
Offline
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 2.3.1.2.ii 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?

kohlert
Offline
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.