Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-939

wsdl defining two different operations on the same port using the same messages lead to wsdl2java producing wrong code instead of an error message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0.2
    • Tooling
    • None

    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

      Attachments

        1. bug.wsdl
          3 kB
          Christian Pfeifhofer

        Activity

          People

            maomaode maomaode
            pc Christian Pfeifhofer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: