[
https://issues.apache.org/jira/browse/CXF-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976867#comment-13976867
]
Claude-Alain commented on CXF-3662:
-----------------------------------
In this example, there is a normal response and an error. In that case, the
error can be treated with an exception mapper. In case there a additional
response (for example with status code = 204), I think it would be more logical
to have a return type "javax.ws.rs.core.Response" instead of taking the first
one.
> wadl2java : Return types aren't generated properly on server interfaces for
> methods with more than 1 response element.
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3662
> URL: https://issues.apache.org/jira/browse/CXF-3662
> Project: CXF
> Issue Type: Bug
> Components: Tooling
> Affects Versions: 2.4.1
> Environment: 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)
> Reporter: Ceri Hughes
> Assignee: Sergey Beryozkin
> Fix For: 2.4.2, 2.5
>
>
> My wadl file frequently has more than 1 response element in the method
> elements, i.e.:
> {code}
> <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>
> {code}
> 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
--
This message was sent by Atlassian JIRA
(v6.2#6252)