Hi 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 <[email protected]>wrote: > 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 > > > > > >
