You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "KARR, DAVID (ATTCINW)" <dk...@att.com> on 2009/12/29 19:09:36 UTC

What suddenly caused my results to use a non-default namespace?

I've been slowly developing my CXF (2.2.5) REST app for several weeks, a
couple weeks ago I added a namespace to the result, and it's been
producing it as the default namespace, so none of the elements specify a
namespace prefix.  Today, after I made an arbitrary change to one
element, adding a "Map" property, now all results (even ones that don't
have that "Map" property) are using a "ns2" prefix.  The output is still
well-formed and valid, but I wish it would use the default namespace, if
it's possible.

RE: What suddenly caused my results to use a non-default namespace?

Posted by "KARR, DAVID (ATTCINW)" <dk...@att.com>.
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozk@progress.com]
> Sent: Tuesday, December 29, 2009 1:14 PM
> To: users@cxf.apache.org
> Subject: RE: What suddenly caused my results to use a non-default
> namespace?
> 
> Hi
> 
> Would annotating this Map property with XmlJavaTypeAdapter help ?

Interesting, but I don't see how that would make any difference.  The
results I get are valid, just not optimal.  The XmlJavaTypeAdapter gives
me more control over what object gets marshaled or how it gets
marshaled, but my issue comes in during the marshalling itself.

In any case, I had to remove the Map attribute because the JPA mapping
machinery for maps doesn't work with my table/column arrangement, so I
had to synthesize something different.  As a result, I don't technically
have that namespace problem anymore. :)

> > -----Original Message-----
> > From: KARR, DAVID (ATTCINW)
> > Sent: Tuesday, December 29, 2009 10:10 AM
> > To: users@cxf.apache.org
> > Subject: What suddenly caused my results to use a non-default
> > namespace?
> >
> > I've been slowly developing my CXF (2.2.5) REST app for several
> weeks,
> > a
> > couple weeks ago I added a namespace to the result, and it's been
> > producing it as the default namespace, so none of the elements
> specify
> > a
> > namespace prefix.  Today, after I made an arbitrary change to one
> > element, adding a "Map" property, now all results (even ones that
> don't
> > have that "Map" property) are using a "ns2" prefix.  The output is
> > still
> > well-formed and valid, but I wish it would use the default
namespace,
> > if
> > it's possible.
> 
> I verified the presence of the Map property caused the prefix to
appear
> on all entities, not just the one with the Map property.  When I
> removed
> the Map property, all the outputs went back to using the default
> namespace.

RE: What suddenly caused my results to use a non-default namespace?

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi

Would annotating this Map property with XmlJavaTypeAdapter help ?

Cheers, Sergey 

> -----Original Message-----
> From: KARR, DAVID (ATTCINW)
> Sent: Tuesday, December 29, 2009 10:10 AM
> To: users@cxf.apache.org
> Subject: What suddenly caused my results to use a non-default
> namespace?
> 
> I've been slowly developing my CXF (2.2.5) REST app for several weeks,
> a
> couple weeks ago I added a namespace to the result, and it's been
> producing it as the default namespace, so none of the elements specify
> a
> namespace prefix.  Today, after I made an arbitrary change to one
> element, adding a "Map" property, now all results (even ones that
don't
> have that "Map" property) are using a "ns2" prefix.  The output is
> still
> well-formed and valid, but I wish it would use the default namespace,
> if
> it's possible.

I verified the presence of the Map property caused the prefix to appear
on all entities, not just the one with the Map property.  When I removed
the Map property, all the outputs went back to using the default
namespace.

RE: What suddenly caused my results to use a non-default namespace?

Posted by "KARR, DAVID (ATTCINW)" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID (ATTCINW)
> Sent: Tuesday, December 29, 2009 10:10 AM
> To: users@cxf.apache.org
> Subject: What suddenly caused my results to use a non-default
> namespace?
> 
> I've been slowly developing my CXF (2.2.5) REST app for several weeks,
> a
> couple weeks ago I added a namespace to the result, and it's been
> producing it as the default namespace, so none of the elements specify
> a
> namespace prefix.  Today, after I made an arbitrary change to one
> element, adding a "Map" property, now all results (even ones that
don't
> have that "Map" property) are using a "ns2" prefix.  The output is
> still
> well-formed and valid, but I wish it would use the default namespace,
> if
> it's possible.

I verified the presence of the Map property caused the prefix to appear
on all entities, not just the one with the Map property.  When I removed
the Map property, all the outputs went back to using the default
namespace.