Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 9999 invoked from network); 1 Oct 2010 20:20:32 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Oct 2010 20:20:32 -0000 Received: (qmail 34089 invoked by uid 500); 1 Oct 2010 20:20:31 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 34047 invoked by uid 500); 1 Oct 2010 20:20:31 -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 34039 invoked by uid 99); 1 Oct 2010 20:20:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Oct 2010 20:20:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,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.214.41 as permitted sender) Received: from [209.85.214.41] (HELO mail-bw0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Oct 2010 20:20:24 +0000 Received: by bwz10 with SMTP id 10so3389207bwz.0 for ; Fri, 01 Oct 2010 13:20:04 -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:cc:content-type; bh=MJvX2vb8LSjMJTkuXtBFMPpn30Jt7xzf7temecvXiGU=; b=QEXzkjOnSG7mrstjO/XsPQMJOSEDCldia6Q67lotx17+gIRwr9JJV0JJ/dgKx2qgek 0BAynlO3GiPIuw0OBXsAlH0tum46+55Z2yUY0Mp/xApYayUNSnPnILxlobG2NAO2TfTz sKFa4NNJ+FJPtUkLJGoaoRNL6qPPQKjKhHs7g= 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 :cc:content-type; b=Xrv3eTFlxEvvy/FUVviiq/Eu6XoDHUfMoPQX/MnX8a2CEy2AmtGWTCKYzjmNSqPKN/ BxCMOG0dPGZVz8l0I3u7X0z0tB2FV376PmdyM43rCCeAjEQ1sCx35zEim1oDVDmT2h9L fEOIYo9IA/+o6hSsTGwex+H2YGiBtg7Kbj/LU= MIME-Version: 1.0 Received: by 10.204.48.75 with SMTP id q11mr4525696bkf.0.1285964404045; Fri, 01 Oct 2010 13:20:04 -0700 (PDT) Received: by 10.204.155.87 with HTTP; Fri, 1 Oct 2010 13:20:03 -0700 (PDT) In-Reply-To: <201010011552.07025.dkulp@apache.org> References: <0A95DE316D40F244B65989915C978B072E89A5C41E@KEX-US-CLUS02.KRONOS.COM> <0A95DE316D40F244B65989915C978B072E89A5C452@KEX-US-CLUS02.KRONOS.COM> <201010011552.07025.dkulp@apache.org> Date: Fri, 1 Oct 2010 21:20:03 +0100 Message-ID: Subject: Re: Aegis Binding without namespaces From: Sergey Beryozkin To: users@cxf.apache.org Cc: "Kampf, Eric" Content-Type: multipart/alternative; boundary=0016e6dd85c67f3ac1049193eb43 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6dd85c67f3ac1049193eb43 Content-Type: text/plain; charset=ISO-8859-1 Yes, this should work, override a createReader method in the provider and return a custom reader, here's a basic example : http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomXmlStreamReader.java cheers, Sergey On Fri, Oct 1, 2010 at 8:52 PM, Daniel Kulp wrote: > On Friday 01 October 2010 2:28:34 pm Kampf, Eric wrote: > > Sergey, > > > > I implemented your suggestion and it worked for outgoing data. > > Unfortunately incoming data is an issue. Aegis still requires the > > namespace information to be able to unmarshal the XML. > > > > So what I am really looking for is a way to entirely disable namespace > > mapping in the binding. I realize it is not directly supported, but > > perhaps there is some way to "trick" the binding? Any suggestions? > > Is it possible to do the reverse on the way in? Wrapper the > XMLStreamReader > with one that always returns a preconfigured namespace for all the calls > the > pull a namespace? > > Dan > > > > > > Thanks again for all your help to this point. > > > > -Eric > > > > -----Original Message----- > > From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] > > Sent: Wednesday, September 29, 2010 5:45 AM > > To: users@cxf.apache.org > > Subject: Re: Aegis Binding without namespaces > > > > Hi Eric > > > > the way you can do it is as follows. > > > > Extend AegisElementProvider [1] and override its createStreamWriter > method > > and create a custom writer, see [2] for an example, just pass to it the > > writer instance AegisElementProvider creates. > > > > You just probably need to override writeNamespace(...) with a no-op > > implementation and writeStartElement and block the namespaces. > > > > I believe you work with DOSGI. In that case, do not use > > org.apache.cxf.rs.databindng property but rather an > > "org.apache.cxf.rs.providers" and list the full name of your custom > > provider. > > > > hope it helps, Sergey > > > > [1] > > > http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/o > > rg/apache/cxf/jaxrs/provider/AegisElementProvider.java [2] > > > http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/ > > apache/cxf/systest/jaxrs/CustomXmlStreamWriter.java > > > > On Wed, Sep 29, 2010 at 2:15 AM, Kampf, Eric > wrote: > > > Yes the reason for this is that our primary clients are mobile devices, > > > some of which have very limited XML parsing capabilities. REST seems > to > > > emphasize simplicity and namespace handling is not always simple. SOAP > > > is a little too 2009 for my taste. :-) > > > > > > -----Original Message----- > > > From: Benson Margulies [mailto:bimargulies@gmail.com] > > > Sent: Tuesday, September 28, 2010 9:09 PM > > > To: users@cxf.apache.org > > > Subject: Re: Aegis Binding without namespaces > > > > > > It's a big problem. The mapping of packages to namespaces avoids > > > collisions. If you don't want namespaces, then you have to find > > > another solution. > > > > > > I personally find no-namespace XML to be entirely too 1999 for my > > > taste, but I imagine that you have a good reason for it. > > > > > > On Tue, Sep 28, 2010 at 4:49 PM, Daniel Kulp wrote: > > > > I honestly don't think anyone has looked at this at all. If it's > > > > > > something > > > > > > > you need, you'll likely have to work on it and submit patches. > > > > > > > > Dan > > > > > > > > On Tuesday 28 September 2010 4:26:35 pm Kampf, Eric wrote: > > > >> Hello, > > > >> > > > >> I would like to use CXF's Aegis data binding for a REST service (I > > > >> have multiple reasons for preferring Aegis over JAXB...). The > > > >> biggest impediment I face however is the presence of namespaces on > > > >> all elements. This will be a hardship for most of our clients. > > > >> > > > >> I see that this topic came up a couple of years ago on this list: > > > >> > http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04683.htm > > > >> l > > > > > > . > > > > > > >> It even resulted in the creation of a JIRA issue which is still > listed > > > > > > as > > > > > > >> open: > > > > https://issues.apache.org/jira/browse/CXF-1291?page=com.atlassian.jira.pl > > > u > > > > > > >> gin.system.issuetabpanels:comment-tabpanel. > > > >> > > > >> Does anyone know if there is a solution for this? Our clients are > > > > > > simply > > > > > > >> not going to be able to use namespaces. Is there any hope of > > > > > > configuring > > > > > > >> Aegis to function without namespaces? > > > >> > > > >> Thanks. > > > >> > > > >> -Eric > > > > > > > > -- > > > > Daniel Kulp > > > > dkulp@apache.org > > > > http://dankulp.com/blog > > -- > Daniel Kulp > dkulp@apache.org > http://dankulp.com/blog > --0016e6dd85c67f3ac1049193eb43--