Description
A WSDL defining two operations on the same port with different names but using the same message names for request and response lead to wrong code instead of an error message. wsdl2java produces a port interface class with both operations, but with wrong runtime behavior. The request of a client invoking the second operation will be routed to the implementation of the first operation at the service provider site.
This is the code generated:
@WebService(targetNamespace = "http://bugs.cxf/services/bug1", name = "myBug1Port")
public interface MyBug1Port {
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(targetNamespace = "http://bugs.cxf/services/bug1", partName = "parameters", name = "myBug1Response")
@WebMethod
public cxf.bugs.services.bug1.ResponseDataType myBug2(
@WebParam(targetNamespace = "http://bugs.cxf/services/bug1", partName = "parameters", name = "myBug1")
cxf.bugs.services.bug1.RequestDataType parameters
);
@ResponseWrapper(targetNamespace = "http://bugs.cxf/services/bug1", className = "cxf.bugs.services.bug1.ResponseDataType", localName = "myBug1Response")
@RequestWrapper(targetNamespace = "http://bugs.cxf/services/bug1", className = "cxf.bugs.services.bug1.RequestDataType", localName = "myBug1")
@WebResult(targetNamespace = "http://bugs.cxf/services/bug1", name = "myOutputString")
@WebMethod
public java.lang.String myBug1(
@WebParam(targetNamespace = "http://bugs.cxf/services/bug1", name = "myInputString")
java.lang.String myInputString
);
}
The jaxws ri produces an error message instead, as two operations with equal message names are illegal at the same port:
Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port myBug1, Operations "myBug2" and "myBug1" have the same request body block
{http://bugs.cxf/services/bug1}myBug1