cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5701) wadl response with JAXB + headers should optionally generate JAX-RS Response
Date Tue, 22 Apr 2014 13:28:17 GMT

    [ https://issues.apache.org/jira/browse/CXF-5701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976750#comment-13976750
] 

Sergey Beryozkin commented on CXF-5701:
---------------------------------------

The request and response contexts can provide the relevant info, example, you can check the
response entity, etc. However, I'm not sure what is the right way to get ETag generated inside
the filter persisted inside the application resource, may be have it implementing ContainerResponseFilter,
etc...It can become a bit not clean all right...Hence the need for the improvement :-)

> wadl response with JAXB + headers should optionally generate JAX-RS Response
> ----------------------------------------------------------------------------
>
>                 Key: CXF-5701
>                 URL: https://issues.apache.org/jira/browse/CXF-5701
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 2.7.10
>         Environment: Little-Net:users-api minfrin$ java -version
> java version "1.6.0_65"
> Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
> Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
>            Reporter: Graham Leggett
>
> When I run wadl2java on the following fragment of wadl, I get the API interface defined
below:
> {code}
>        <response status="200">
>          <representation mediaType="application/json" element="user:users"/>
>          <representation mediaType="application/xml" element="user:users"/>
>          <param name="ETag" style="header" type="xsd:string">
>            <doc>The SHA1 hash of the sum of DN and modifiedTimestamp of the matching
users.</doc>
>          </param>
>          <param name="Cache-Control" style="header" type="xsd:string">
>            <doc>The Cache-Control header as specified through configuration in
context.xml.</doc>
>          </param>
>          <param name="Vary" style="header" type="xsd:string">
>            <doc>MUST have the value "Authorization", as we vary on the Authorization
header.</doc>
>          </param>
>          <doc>Return list of users.  Must have admin role to receive the response.

>               Note: no users = empty list with status:200</doc>
>        </response>
> {code}
> {code}
>    @GET
>    @Produces({"application/json", "application/xml" })
>    Users getUsers(@QueryParam("page") Long page, @QueryParam("pageSize") Long pageSize,
@QueryParam("sort") String sort, @QueryParam("fl") String fl, 
>                @HeaderParam("If-None-Match") String If_None_Match, @HeaderParam("Authorization")
String Authorization);
> {code}
> The problem with the interface that is being produced above is that we return a JAXB
Users object, with no mechanism to return any of the ETag, Cache-Control or Vary headers as
required by the wadl.
> To maintain backwards compatibility we need an option to send the correct response based
on whether headers are present or not.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message