cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <>
Subject Re: Need CXF to marshal JAXB bean to JSON
Date Tue, 01 Jun 2010 17:34:25 GMT

Perhaps you can use a CXF JAXRS WebClient in the A servlet, for talking to
the servlet B ?
By setting an json specific media type on this WebClient you can get JSON on
the wire, still reusing JAXB beans; you can register Jackson if needed too
with a given WebClient

cheers, Sergey

On Tue, Jun 1, 2010 at 4:24 PM, Willard, Jonathan

> I have two servlets, A the CXF servlet can receive and respond to
> RESTful HTTP calls using JAXB beans.  Servlet B (on a different machine)
> is not using CXF but it makes calls to servlet A providing a URL and
> user credentials.  At some point in time servlet A will send data to
> Servlet B using the provided URL and credentials.  This is working well
> but does not support JSON because the message from Servlet A to Servlet
> B is not a JAX-RS message.  I would like to be able to use the CXF jars
> in servlet A to create a XML or JSON message from my JAXB bean.  It
> would appear that I need to create a CXF marshaler and call the
> MessageBodyWriter.  Right now I am using the JAXB marshaller and it does
> not appear to produce JSON.
> Can anyone offer a good solution to this?
> Jon Willard

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message