cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From LeszekM <spon...@poczta.onet.pl>
Subject CXF how to definie Response Type in Request Header ?
Date Thu, 23 Oct 2008 09:45:10 GMT

Hi
I am new to CXF and I am trying to write a CXF Service using JAX RS
Annotations. The problem is, that in this case the type of  Servers's
response (XML/JSON), is defined in Request Header like:
X-UI-FORMAT=JSON|XML. 
Here is what I have to do:

@GET
@Path("getCustomer")
public Customer getCustomer() {
   if request.header.equals("application/json") return Customer in JSON
format
   else return Customer in XML format 
}

I couldn't find the solution neither in Forum nor in CXF samples. And
ProduceMime annotation doesn't seem to work in this case, as only one is
allowed.

Is there any solution to this problem ?
Thanks, 
Leszek Mysliwiec

-- 
View this message in context: http://www.nabble.com/CXF-how-to-definie-Response-Type-in-Request-Header---tp20127708p20127708.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message