Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: Annotations
-
Labels:None
-
Number of attachments :
Description
It appears that the wsdl generated from web service annotations do not include all the types it refernces internally, nor does it include an import statement to include these definitions via an external xml schema. This should be able to be reproduced by following these steps:
Create an xml schema that includes something like:
<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>
Define the service via (here IDoSomething is the exact interface without service annotations):
@WebService(name = "IDoSomething", targetNamespace = "http://www.example.com/2006/dosomething")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle = ParameterStyle.BARE)
public interface IDoSomethingService extends IDoSomething
I use spring to create the factory and services. Not positive this matters, though it should not. Register the service, check the published wsdl:
<wsdl:definitions targetNamespace="http://www.emergent.net/2006/servertools/processmanagement/model">
<wsdl:types>
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.emergent.net/2006/servertools/processmanagement/model">
<xsd:element name="doSomething" type="tns:doSomething"/>
<xsd:element name="doSomethingResponse" type="tns:doSomethingResponse"/>
</xsd:schema>
...(the rest)
</wsdl:definitions>
Note that there is not a definiton of tns:doSomething, tns:doSomethingDetails, or the types it is composed of so accurate bindings could never be generated from the wsdl alone.
Thanks
Thatcher
I am having the exact same issue. In my case, I am unable to create client bindings in .NET. I was hopeful with this when I saw that doc/literal/bare services could be created using annotations, but I am considering backing out annotations and going back to a WSDL-first approach.
Like the poster, I also use Spring for the factories and services. My bindings are XmlBeans if that matters.