Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 4432 invoked from network); 10 Feb 2009 11:48:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Feb 2009 11:48:44 -0000 Received: (qmail 71005 invoked by uid 500); 10 Feb 2009 11:48:44 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 70954 invoked by uid 500); 10 Feb 2009 11:48:43 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 70943 invoked by uid 99); 10 Feb 2009 11:48:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2009 03:48:43 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.77.186.17] (HELO mx3.progress.com) (192.77.186.17) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2009 11:48:32 +0000 Received: from mx3.progress.com (127.0.0.1) by mx3.progress.com (MlfMTA v3.2r9) id hi5kp00171sg for ; Tue, 10 Feb 2009 06:48:10 -0500 (envelope-from ) Received: from progress.com ([192.233.92.16]) by mx3.progress.com (SonicWALL 6.2.2.1073) with ESMTP; Tue, 10 Feb 2009 06:48:10 -0500 Received: from NTEXFE01.bedford.progress.com (ntexfe01 [10.128.10.24]) by progress.com (8.13.8/8.13.8) with ESMTP id n1ABm9oB027692 for ; Tue, 10 Feb 2009 06:48:09 -0500 (EST) Received: from sberyoz ([10.5.2.12]) by NTEXFE01.bedford.progress.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 10 Feb 2009 06:48:08 -0500 Message-ID: <00d001c98b75$71a25bb0$0c02050a@emea.progress.com> From: "Sergey Beryozkin" To: References: <00a201c98b6d$07a72360$0c02050a@emea.progress.com> Subject: Re: JSON in CXF Date: Tue, 10 Feb 2009 11:48:06 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-OriginalArrivalTime: 10 Feb 2009 11:48:09.0056 (UTC) FILETIME=[71A0AE00:01C98B75] X-Mlf-Version: 6.2.2.1073 X-Mlf-UniqueId: o200902101148100208127 X-Virus-Checked: Checked by ClamAV on apache.org Hi Gary, I thought first you might be talking about this issue : http://cwiki.apache.org/CXF20DOC/jax-rs.html#JAX-RS-DealingwithJSONarrayserializationissues (thanks Andy for adding a TOC :-)) but then after looking at the code it seems that it's not the case ... Is it when registering a ContextResolver implementation which will customize the way Foo.class is being serialized can help ? I'll also check if what you're after is possible with Jettison Cheers, Sergey ----- Original Message ----- From: "Tong, Gary (FID)" To: Sent: Tuesday, February 10, 2009 11:24 AM Subject: RE: JSON in CXF I think it's a limitation of the underlying JSON library. Something like: @XmlRootElement public class Foo { @XmlElementWrapper(name="values") @XmlElement(name="value") private List values } Gives XML like: foo bar And json like: {foo: {values: {value: ["foo", "bar"]}}} Whereas really, if this is an API that you want to publicize, you really want: {values: ["foo", "bar"]} Seems like the JSON is generated via JAXB and an XMLStreamWriter, which unfortunately is too limited to provide real control over the JSON. Thanks, Gary -----Original Message----- From: Sergey Beryozkin [mailto:sberyozk@progress.com] Sent: 10 February 2009 10:48 To: dev@cxf.apache.org Subject: Re: JSON in CXF Hi Gary > JSON via JAXB definitely leaves something to be desired. Do you reckon it's the limitations of the underlying JSON library that we use (Jettison) or do you refer to the insufficient number of hooks for our JSON JAXRS reader/writer whiich would help in producing a better quality JSON ? Can you post some examples please - I hope it will help us to improve what we have Thanks, Sergey Hi guys, I really like how CXF provides both JSON and XML out of the box. However, after working with the JSON serializer a bit, it's obvious that the JAXB annotations translate poorly to JSON, and that while you have great control over XML via JAXB, JSON via JAXB definitely leaves something to be desired. Do you guys know of any jaxb-quality, annotation-driven JSON serializers? Cheers, Gary -------------------------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This is not research and is not from MS Research but it may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via e-mail will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are professional and eligible counterparties (as defined in the UK Financial Services Authority's rules). -------------------------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This is not research and is not from MS Research but it may refer to a research analyst/research report. Unless indicated, these views are the author’s and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via e-mail will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are professional and eligible counterparties (as defined in the UK Financial Services Authority’s rules).