cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: JSON + Aegis + JAX-RS: Not?
Date Tue, 08 Sep 2009 20:28:18 GMT

I'm completely lost on most of this discussion, but thought I'd pop in with 
couple ideas that may or may not be applicable:

1) In CXF, all the subclasses of AbstractDataBinding already have a 
namespaceMap in them where the use CAN (not require) configure prefixes in if 
they want.  It might be good to push them into jettison.   Keeps them 
consistent between soap/json.

2) You might be able to loop through the schemaCollection for all the 
namespaces up front to avoid the DOM thing.   Doesn't solve the real prefix 
mapping issue though.    You could at least make it predictable by sorting the 
namespaces and assigning them ns# based on the sorting order.

If I think of more, I'll happily speak up.   :-)


On Sat September 5 2009 1:52:10 pm Benson Margulies wrote:
> Well, so, I've been working on the soggy saga of JAX-RS + Aegis + Jettison.
> I won't repeat other recent messages too much.
> Aegis likes to write namespaces. There is no option to use it unqualified.
> Jettison is really weak on namespaces. It someone to know all the
>  namespaces and prefixes in advance of creating a StaX stream. That's not
>  very realistic for Aegis.
> Jettison doesn't write out the definition of namespaces for you. You tell
>  it that namespace X maps to prefix P, and it writes strings of the form
>  P.qqqq, and never writes a definition of P.
> I have danced around all of this by making the JAX-RS Aegis provider write
> to DOM first, and then collect all the namespace prefixes, and then push it
> to jettison. I have no idea how to make the read side work consistently in
> any non-brittle way. Given that any sort of object, in any package, could
> turn up as a subclass, there's just no way to know what all the namespaces
> will be in advance. More to the point, when reading, seeing 'ns3.bloop',
> there's no way to tell what namespace should go with ns3. Very simple cases
> work where there's only one namespace.
> This might be addressed by prefixing an actual namespace map, and reading
> it. Alternatively, we could use a completely different scheme for handling
> namespaces than Jettison. Instead of adding prefixes to the element names,
> put them all in attributes (say, well, 'xmlns' attributes, by URI). Then we
> wouldn't lose any information.
> It could be argued that this combination is just a really bad idea. If you
> want JSON, you want a binding that can do unqualified elements. And if the
> DOSGi gang wants to avoid JAX-B that badly, perhaps someone from in there
> would like to add unqualified support to Aegis?

Daniel Kulp

View raw message