Use of SOAPBinding.ParameterStyle.WRAPPED in annotations produces incorrect
descriptions of wrapped parameters
--------------------------------------------------------------------------------------------------------------
Key: XFIRE-716
URL: http://jira.codehaus.org/browse/XFIRE-716
Project: XFire
Issue Type: Bug
Components: Annotations
Affects Versions: 1.2.2
Reporter: chris thatcher
Assigned To: Dan Diephouse
Priority: Critical
It appears as thought use of SOAPBinding.ParameterStyle.WRAPPED does not
correctly wrap parameters. This is a complicated issue and took me several
days to discover. I am largely basing my decision to report this as a critical
bug on my knowledge of the soap spec and the behavior of other implementations,
mainly JAXWS.
First suppose I have generated my jaxb types from a schema incuding:
<xs:complexType name="doSomethingDetails">
<xs:sequence>
<xs:element name="goop" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="draw" type="xs:string" />
</xs:complexType>
<xs:complexType name="doSomethingResponseDetails">
<xs:sequence>
<xs:element name="foo" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="bar" type="xs:string" />
</xs:complexType>
which gives me the classes DoSomethingDetials and DoSomethingResponseDetails
next I have an annotated class like:
@WebService(name = "IDoSomething", targetNamespace =
"http://www.example.com/2006/dosomething")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle =
ParameterStyle.WRAPPED) public interface IDoSomethingService extends
IDoSomething{
@WebMethod(operationName = "doSomething", action = "doSomething")
@WebResult(name = "doSomethingResponse", targetNamespace =
"http://www.example.com/2006/dosomething")
public DoSomethingResponseDetails doSomething(
@WebParam(name = "doSomethingDetails", targetNamespace =
"http://www.example.com/2006/dosomething")
DoSomethingDetails doSomethingDetails);
}
Then the generated wsdl types *should* be something like:
<wsdl:types>
<xsd:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://www.emergent.net/2006/servertools/processmanagement/model">
<xs:element name="doSomething" type="tns:doSomething" />
<xs:complexType name="doSomething">
<xs:sequence>
<xs:element name="doSomethingDetails" type="tns:doSomethingDetails"
minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="doSomethingResponse" type="tns:doSomethingResponse" />
<xs:complexType name="doSomethingResponse">
<xs:sequence>
<xs:element name="doSomethingResponseDetails"
type="tns:doSomethingResponseDetails" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="doSomethingDetails">
<xs:sequence>
<xs:element name="goop" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="draw" type="xs:string" />
</xs:complexType>
<xs:complexType name="doSomethingResponseDetails">
<xs:sequence>
<xs:element name="foo" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="bar" type="xs:string" />
</xs:complexType>
</xsd:schema>
...(the rest)
</wsdl:definitions>
This is what JAXWS produces. However XFire creates an additional layer like:
<wsdl:types>
<xsd:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://www.emergent.net/2006/servertools/processmanagement/model">
<xs:element name="doSomething" type="tns:doSomething" />
<xs:complexType name="doSomething">
<xs:sequence>
<xs:element name="doSomething" type="tns:doSomething" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="doSomethingResponse" type="tns:doSomethingResponse" />
<xs:complexType name="doSomethingResponse">
<xs:sequence>
<xs:element name="doSomethingResponse" type="tns:doSomething"
minOccurs="0"/>
</xs:sequence>
</xs:complexType>
which double wraps the parameters. There are many variations on this theme
however I think the basic pattern for wrapped (at least with jaxb2) should
create an wrapper element as specified by the annotation, then use the
ObjectFactory to create the nested element which is declared as the
input/output type. If you cannot reproduce this please let me know and I will
try to take the time to create an end to end example with XFire. Of course you
may also disagree that this is the intended behaviour. In general I think you
can deduce the difference in behaviour by using the wsgen task as defined by by
the JAXWS dist on an annotated class using a WRAPPED parameter style and
compare that to that produced by xfire.
Thanks,
Thatcher
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email