CXF
  1. CXF
  2. CXF-1414

cxf-codegen-plugin generates incomplete method signatures for operations with multiple faults defined

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: 2.0.4
    • Fix Version/s: Invalid
    • Component/s: Tooling
    • Labels:
      None
    • Environment:

      MacOS 10.5, Eclipse, Maven 2.0.8

      Description

      When a WSDL defines multiple faults for a given operation, tooling fails to generate a method signature with all defined faults as exceptions. Only the last defined exception is defined as part of the method signature for the operation. Example:

      <wsdl:operation name="addPlayerToTeam">
      <wsdl:input message="baseball:addPlayerToTeamRequest"></wsdl:input>
      <wsdl:fault name="fault"
      message="baseball:teamNotFoundException">
      </wsdl:fault>
      <wsdl:output message="baseball:addPlayerToTeamResponse"></wsdl:output>
      <wsdl:fault name="fault"
      message="baseball:playerNotFoundException">
      </wsdl:fault>
      </wsdl:operation>

      Generates an incorrect method signature of:

      @ResponseWrapper(localName = "addPlayerToTeamResponse", targetNamespace = "http://baseball/", className = "baseball.AddPlayerToTeamResponse")
      @RequestWrapper(localName = "addPlayerToTeam", targetNamespace = "http://baseball/", className = "baseball.AddPlayerToTeam")
      @WebResult(name = "contractId", targetNamespace = "")
      @WebMethod
      public int addPlayerToTeam(
      @WebParam(name = "playerId", targetNamespace = "")
      int playerId,
      @WebParam(name = "teamId", targetNamespace = "")
      int teamId
      ) throws PlayerNotFoundException;

        Activity

        Ryan Norris created issue -
        Hide
        Ryan Norris added a comment -

        Have attached a sample project demonstrating this issue

        Show
        Ryan Norris added a comment - Have attached a sample project demonstrating this issue
        Ryan Norris made changes -
        Field Original Value New Value
        Attachment cxf1414-sample.zip [ 12374658 ]
        Hide
        Daniel Kulp added a comment -

        The included wsdl is not a valid wsdl. According to the wsdl spec:

        "Each fault element must be named to allow a binding to specify the concrete format of the fault message. The name of the fault element is unique within the set of faults defined for the operation."

        Your wsdl names the two faults in the operation with the same name. Since we use the names for lookups in a map, only one fault could be found. If you name the two faults with unique names as the spec requires, it does generate the correct mapping.

        Note: the teamsSOAPBinding binding doesn't have a definition for that operation either. That's possibly also invalid.

        That all said, this did find a couple other bugs that I'll log related to the wsdl validator. The validator NPE's without the proper operation defined in the teamsSOAPBinding, but even with that added, it doesn't find the problem with the fault names. I'll log bugs for those. However, I'm going to close this bug as invalid.

        Dan

        Show
        Daniel Kulp added a comment - The included wsdl is not a valid wsdl. According to the wsdl spec: "Each fault element must be named to allow a binding to specify the concrete format of the fault message. The name of the fault element is unique within the set of faults defined for the operation." Your wsdl names the two faults in the operation with the same name. Since we use the names for lookups in a map, only one fault could be found. If you name the two faults with unique names as the spec requires, it does generate the correct mapping. Note: the teamsSOAPBinding binding doesn't have a definition for that operation either. That's possibly also invalid. That all said, this did find a couple other bugs that I'll log related to the wsdl validator. The validator NPE's without the proper operation defined in the teamsSOAPBinding, but even with that added, it doesn't find the problem with the fault names. I'll log bugs for those. However, I'm going to close this bug as invalid. Dan
        Daniel Kulp made changes -
        Fix Version/s Invalid [ 12312706 ]
        Resolution Invalid [ 6 ]
        Status Open [ 1 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12422656 ] Default workflow, editable Closed status [ 12603759 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        2d 13h 34m 1 Daniel Kulp 06/Feb/08 18:10

          People

          • Assignee:
            Unassigned
            Reporter:
            Ryan Norris
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development