[JAX_WS-1096] Incorrect Schemas generated if two services contains an operation with the same name but different return type Created: 17/Dec/12  Updated: 18/Jan/13

Status: Open
Project: jax-ws
Component/s: runtime
Affects Version/s: 2.2.7
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lukas Jungmann Assignee: miroslav.kos
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive wsimport-issue.zip    

 Description   

-create two entities (or simple DTO for them), ie Customer and Order
-create a web service for each entity with findAll() operation returning collection of given DTO (2 services, CustomerWS and OrderWS)
-deploy a project with these entities and services to GF 3.1.2.2 (or newer)
-check generated WSDLs and schemas

Expected:
one schema defines:

<xs:complexType name="findAllResponse">
<xs:sequence>
<xs:element name="return" type="tns:order" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

the other defines:

<xs:complexType name="findAllResponse">
<xs:sequence>
<xs:element name="return" type="tns:customer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

Actual:
both schemas defines same findAllResponse element therefore on the client side one can get correct response only from one of the services

Workaround:
I haven't found combination of JAXB annotations to be put on DTOs which would make sure that schemas are generated correctly, so the only workaround seems to be to download wsdl/xsds, edit them and use them in @WebService.wsdlLocation



 Comments   
Comment by Lukas Jungmann [ 17/Dec/12 ]

few notes:
-this is reproducible also in GF 2.1.1
-using @WebMethod(operationName = "findAllOrders") and @WebMethod(operationName = "findAllCustomers") for service operations makes this issue more visible and shows that correct elements in schema can be generated but they're incorrectly bound to matching web service operations (-this changes the right and wrong schemas)
-if wsgen is used on the command line, WSDLs and schemas seem to be generated correctly (but this might be related to the fact that one can pass only one SEI to ws gen)

Generated at Sat Feb 28 23:29:50 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.