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

wadl2java : Return types aren't generated properly on server interfaces for methods with more than 1 response element.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.1
    • 2.4.2, 2.5
    • Tooling
    • None
    • Windows 7 32 bit
      java version "1.6.0_26"
      Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
      Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

    Description

      My wadl file frequently has more than 1 response element in the method elements, i.e.:

      <method name="GET" id="getUserDefaults">
      	<doc>Gets default user configuration values.</doc>
      	<response status="200">
      		<representation mediaType="application/xml" element="fmc:userDefaults" />
      	</response>
      	<response status="400">
      		<representation mediaType="application/xml" element="fmc:errorList" />
      	</response>
      </method>
      

      If there is more than 1 response element, the wadl2java tool assumes that the return type from generated methods is always void. There is a line of code that checks for exactly 1 response element - if there isn't 1 (i.e. 0 or more than 1), then void is assumed. Can it not take the representation of the 1st response in a case when there is more than 1 (or better, the representation from the response with a success status)?

      See the first line of org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.writeResponseType

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            cerihughes Ceri Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: