parameterStyle.BARE or Wrapped

Hi,

working with wsimport, I have noticed that some times it generates an Interface with different parameterStyle

so for example, for this type of declaration

<xsd:complexType name="poll">

<xsd:sequence>

<xsd:element maxOccurs="1" minOccurs="1" name="jobid" type="xsd:string">

</xsd:element>

<xsd:element maxOccurs="1" minOccurs="1" name="filetype" type="xsd:string">

</xsd:element>

</xsd:sequence>

</xsd:complexType>

<xsd:element name="poll" type="tns:poll"/>

it generates the following interface

@WebMethod

@WebResult(name ="result", targetNamespace ="http://www.ebi.ac.uk/ws/wublast", partName ="result")

@SOAPBinding(parameterStyle = ParameterStyle.BARE)

public String poll(

@WebParam(name ="poll", targetNamespace ="http://www.ebi.ac.uk/ws/wublast", partName ="parameters")

Poll parameters);

but for this

<xs:element type="ns1:add" name="add"/>

<xs:complexType name="add">

<xs:sequence>

<xs:element type="xs:int" name="arg0"/>

<xs:element type="xs:int" name="arg1"/>

</xs:sequence>

</xs:complexType>

generates

@WebMethod(action ="urn:Add")

@WebResult(targetNamespace ="")

@RequestWrapper(localName ="add", targetNamespace ="http://techtip.com/jaxws/sample", className ="com.techtip.jaxws.sample.Add")

@ResponseWrapper(localName ="addResponse", targetNamespace ="http://techtip.com/jaxws/sample", className ="com.techtip.jaxws.sample.AddResponse")

publicint add(

@WebParam(name ="arg0", targetNamespace ="")

int arg0,

@WebParam(name ="arg1", targetNamespace ="")

int arg1);

}

so the two parameters are separated,

how does it decide on which style to choose? how can I configure it in the WSDL? can I override this modifying the Interface?

thanks

Alberto

[3119 byte] By [imaginatioa] at [2007-10-2 20:08:53]
# 1

Hi,

I have the same problem. If I use the example that comes with JAXWS (AddNumbers) then it generates a method with two input parameters, but if I try my own wsdl it just uses the wrapper class as single input parameter.

I came across a note that says the characteristics of the wrapped style are:

# The element has the same name as the operation.

# The element's complex type has no attributes.

But my complex type does not have any attributes and the element has the same name as the operation and still wsimport would use BARE style instead of WRAPPED.

Does anyone have some specifications on when wsimport defaults to WRAPPED style and when it uses BARE?

Thanks,

Flo

Flossya at 2007-7-13 22:49:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...