Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E909109DC for ; Thu, 6 Jun 2013 19:32:33 +0000 (UTC) Received: (qmail 67034 invoked by uid 500); 6 Jun 2013 19:32:32 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 66977 invoked by uid 500); 6 Jun 2013 19:32:32 -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 66969 invoked by uid 99); 6 Jun 2013 19:32:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 19:32:32 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: encountered temporary error during SPF processing of domain of tom.stark@polycom.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 19:32:26 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UkfuU-0002e3-01 for users@cxf.apache.org; Thu, 06 Jun 2013 12:31:46 -0700 Date: Thu, 6 Jun 2013 12:31:45 -0700 (PDT) From: tomstark To: users@cxf.apache.org Message-ID: <1370547105992-5728876.post@n5.nabble.com> In-Reply-To: <51B0AEB4.9050500@gmail.com> References: <1370531805351-5728855.post@n5.nabble.com> <51B0AEB4.9050500@gmail.com> Subject: Re: how to specify default namespace in JSON MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Sergey, Thanks for the quick response. I neglected to mention that I was already setting the ignoreNamespaces property to true. I was hoping that worked on input and output. Looks like it only works on input. Is that true? I see that I'm getting Jettison 1.3.1 so I'll grab 1.3.3 and try that too. In regards to the input transforms, correct me if I misinterpreted the way that works -- I would have to add a transform line for each element in all objects to properly prepend the correct namespace (this would also assume that all elements were uniquely named). This might be pretty voluminous and not easy to maintain. Is there a better way or am I missing something? What would be nice is to recognize the input class (like User.class) and then prepend the correct namespace for elements in that class that don't have an annotation declaring a different namespace. The annotations are in the JAXB generated source. This is what I need but I don't see a way to do this easily. For example: @XmlRootElement(name = "user") public class User implements ETag, Equals, HashCode, ToString { @XmlElement(name = "user-role", namespace = "urn:com:company:api:rest:user-role") protected UserRole userRole; @XmlElement(required = true) protected String username; } Perhaps the problem is that the @XmlRootElement doesn't have its namespace defined? Perhaps there is a setting in the jaxb2 plugin that would emit this for me? Thoughts? -- View this message in context: http://cxf.547215.n5.nabble.com/how-to-specify-default-namespace-in-JSON-tp5728855p5728876.html Sent from the cxf-user mailing list archive at Nabble.com.