Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 39586 invoked from network); 1 Jun 2010 17:34:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Jun 2010 17:34:53 -0000 Received: (qmail 72696 invoked by uid 500); 1 Jun 2010 17:34:52 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 72655 invoked by uid 500); 1 Jun 2010 17:34:52 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 72647 invoked by uid 99); 1 Jun 2010 17:34:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jun 2010 17:34:52 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sberyozkin@gmail.com designates 209.85.161.41 as permitted sender) Received: from [209.85.161.41] (HELO mail-fx0-f41.google.com) (209.85.161.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jun 2010 17:34:46 +0000 Received: by fxm14 with SMTP id 14so513445fxm.0 for ; Tue, 01 Jun 2010 10:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=ILxh83xabSjjwh33jONf/vIhHaDz0LEJgwOxIo6XSV8=; b=vZw6h86VVzOIDj32WjPRna13eo5DKIlNWMAMzSTJsGKRVaRsjHJgb61BLHHI5Bji/v JPTeirj6U341zy5287Ijnyb68jiLTR2Wmo77Kils8BIuV0AOMXbSl5JJnKX0Cjfly/F/ iMjrZ9Ok5pG5gjPP4p744pVzCZPakjKalBiGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nTjRndKjtZiITQDx7aIMDjtIIIHS643+ijMadgi72JhGHC6pqSh4f26xXtItcV7rvj 44dduZKkXobJIEWlGhiGZOM5i3IYsZOC0orwlrAWYt00arIReDMueSDBKF7zeua/tNi1 vUcNHg/1k2UFRGOLvD5MRVuYnb3/1EidGF4Cs= MIME-Version: 1.0 Received: by 10.239.177.77 with SMTP id u13mr503980hbf.26.1275413665908; Tue, 01 Jun 2010 10:34:25 -0700 (PDT) Received: by 10.239.149.4 with HTTP; Tue, 1 Jun 2010 10:34:25 -0700 (PDT) In-Reply-To: <4F803B87DC1D58429A54FB0DB107BA78041F070A@USILMS16.ca.com> References: <4F803B87DC1D58429A54FB0DB107BA78041F070A@USILMS16.ca.com> Date: Tue, 1 Jun 2010 18:34:25 +0100 Message-ID: Subject: Re: Need CXF to marshal JAXB bean to JSON From: Sergey Beryozkin To: users@cxf.apache.org Content-Type: multipart/alternative; boundary=001485f0acc87f8a640487fb6280 X-Virus-Checked: Checked by ClamAV on apache.org --001485f0acc87f8a640487fb6280 Content-Type: text/plain; charset=ISO-8859-1 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 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 > > > > > > --001485f0acc87f8a640487fb6280--