You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by BrianP <Br...@firstdatabank.com> on 2007/11/12 20:43:44 UTC

suppress namespace?

Is there a way to suppress the namespace in the response?  I have just a
simple webservice set up which uses aegis.  For example, my output is
currently this:

<list>
  <ns2:Item xmlns:ns2="http://services.mycompany.com">
    <ns2:desc xmlns="http://services.mycompany.com">item desc</ns2:desc>
    <ns2:id xmlns="http://services.mycompany.com">1</ns2:id>
  </ns2:Item>
  <ns2:Item xmlns:ns2="http://services.mycompany.com">
    <ns2:desc xmlns="http://services.mycompany.com">item desc 2</ns2:desc>
    <ns2:id xmlns="http://services.mycompany.com">22</ns2:id>
  </ns2:Item>
</list>

And I want it to be simply this:

<list>
  <Item>
    <desc>item desc</desc>
    <id>1</id>
  </Item>
  <Item>
    <desc>item desc2</desc>
    <id>22</id>
  </Item>
</list>
-- 
View this message in context: http://www.nabble.com/suppress-namespace--tf4793377.html#a13712697
Sent from the cxf-user mailing list archive at Nabble.com.


aegis - add namespace to @WebResult element?

Posted by BrianP <Br...@firstdatabank.com>.
Ok then, is there a way to add the namespace to the element generated by the
@WebResult annotation? I think I had to add this because the default was to
name that method 'return', which is a reserved word in many places and
caused a problem. But my client is having difficulty processing the
response, and I'm wondering if the problem is the lack of namespace on the
<OrdMedList> element (snippet below), whereas the children of <OrdMedList>
do have a namespace.  I added the 'targetNamespace' attribute to the
@WebResult, but it had no effect of generating a namespace on that element. 
Here's my interface : 

@WebService
public interface OrderableMedService {
	@WebResult(name="OrdMedList",targetNamespace="http://services.company.com")
	OrdMed[] searchStartsWith(@WebParam(name="searchText") String searchText);
}

the actual example that goes along with this is

<OrdMedList>
  <ns2:OrdMed xmlns:ns2="http://service.company.com">
    <desc xmlns="http://service.company.com">tylenol<desc/>
    <id xmlns="http://services.company.com">7606</id>
  </ns2:OrdMed>
  <ns2:OrdMed xmlns:ns2="http://service.company.com">
    <desc xmlns="http://service.company.com">aspirin<desc/>
    <id xmlns="http://services.company.com">444</id>
  </ns2:OrdMed>
</OrdMedList>


dkulp wrote:
> 
> 
> With Aegis, defintely no right now.  :-(   
> 
> Aegis always generates qualified schemas so all the elements are 
> namespace qualified.
> 
> Actually, an "interesting" approach could be to add an interceptor 
> immediately after the StaxOutInterceptor that would wrapper the 
> XMLStreamWriter with a writer that would discard all namespace related 
> events.  
> 
> Dan
> 
> 
> 
> On Monday 12 November 2007, BrianP wrote:
>> Is there a way to suppress the namespace in the response?  I have just
>> a simple webservice set up which uses aegis.  For example, my output
>> is currently this:
>>
>> <list>
>>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
>>     <ns2:desc xmlns="http://services.mycompany.com">item
>> desc</ns2:desc> <ns2:id
>> xmlns="http://services.mycompany.com">1</ns2:id>
>>   </ns2:Item>
>>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
>>     <ns2:desc xmlns="http://services.mycompany.com">item desc
>> 2</ns2:desc> <ns2:id xmlns="http://services.mycompany.com">22</ns2:id>
>> </ns2:Item>
>> </list>
>>
>> And I want it to be simply this:
>>
>> <list>
>>   <Item>
>>     <desc>item desc</desc>
>>     <id>1</id>
>>   </Item>
>>   <Item>
>>     <desc>item desc2</desc>
>>     <id>22</id>
>>   </Item>
>> </list>
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/suppress-namespace--tf4793377.html#a13715122
Sent from the cxf-user mailing list archive at Nabble.com.


Re: suppress namespace?

Posted by Benson Margulies <bi...@gmail.com>.
We need to make Aegis have a place to find
'elementFormDefault='unqualified' '.




On Thu, 2007-12-13 at 09:32 -0800, Dain Sundstrom wrote:
> I see.  So do these toolkits produce messages with namespaces?  If  
> not we're gonna need to add extend aegis to not expect namespaces  
> when reading.  This is one of changes I had to in the extensions for  
> SOAP encoded.
> 
> -dain
> 
> On Dec 12, 2007, at 6:56 PM, Daniel Kulp wrote:
> 
> >
> > Dain,
> >
> > One of the main use cases for  such "namespace free" responses is  
> > for the
> > REST style things where a client does a "get" on a URL and receives an
> > XML response back.    The XML parsers in various toolkits (and  
> > browsers)
> > don't always work well with the namespaces that JAXB and Aegis would
> > always spit out.
> >
> > Most likely, you would register a service on two URL's.   One that  
> > would
> > return a proper XML that is consumable by smarter clients and another
> > that would have the strip interceptor setup.    You may be able to do
> > something really smart in the interceptor like look at the user  
> > agent or
> > something and only strip for certain agents.
> >
> > Dan
> >
> >
> > On Wednesday 12 December 2007, Dain Sundstrom wrote:
> >> On Dec 12, 2007, at 7:55 AM, Daniel Kulp wrote:
> >>> On Wednesday 12 December 2007, Vespa, Anthony J wrote:
> >>>> I would be interested in this as well for Aegis bindings - it does
> >>>> not
> >>>> make some of the JS libraries out there too happy.
> >>>
> >>> That is why doing it at the interceptor level is ideal.   It would
> >>> be completely independent of the databinding.   Heck, you would be
> >>> able to
> >>> feed it a DOMSource if using a Provider<Source> type thing and the
> >>> namespaces would get stripped out as well.
> >>
> >> I'm not sure this can be done with an interceptor.  I'd guess that,
> >> client that expects messages to be namespace free are unlikely to
> >> send messages with the proper namespaces in the first place.  When
> >> aegis sees the xml without namespaces, it isn't going match nested
> >> elements in the BeanType class to the xml elements because it matches
> >> on qname.
> >>
> >>  From what I have seen of the BeanType code, think that you can make
> >> aegis expect namespace free nested elements using a new TypeCreater
> >> which creates BeanTypes with no namespace expectations.  This is how
> >> the StructType works.
> >>
> >> Now that I think about it, I bet the javascript libraries are
> >> expecting soap encoding which doesn't have namespace qualified nested
> >> elements.
> >>
> >> -dain
> >
> >
> >
> > -- 
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog
> 


Re: suppress namespace?

Posted by Dain Sundstrom <da...@iq80.com>.
I see.  So do these toolkits produce messages with namespaces?  If  
not we're gonna need to add extend aegis to not expect namespaces  
when reading.  This is one of changes I had to in the extensions for  
SOAP encoded.

-dain

On Dec 12, 2007, at 6:56 PM, Daniel Kulp wrote:

>
> Dain,
>
> One of the main use cases for  such "namespace free" responses is  
> for the
> REST style things where a client does a "get" on a URL and receives an
> XML response back.    The XML parsers in various toolkits (and  
> browsers)
> don't always work well with the namespaces that JAXB and Aegis would
> always spit out.
>
> Most likely, you would register a service on two URL's.   One that  
> would
> return a proper XML that is consumable by smarter clients and another
> that would have the strip interceptor setup.    You may be able to do
> something really smart in the interceptor like look at the user  
> agent or
> something and only strip for certain agents.
>
> Dan
>
>
> On Wednesday 12 December 2007, Dain Sundstrom wrote:
>> On Dec 12, 2007, at 7:55 AM, Daniel Kulp wrote:
>>> On Wednesday 12 December 2007, Vespa, Anthony J wrote:
>>>> I would be interested in this as well for Aegis bindings - it does
>>>> not
>>>> make some of the JS libraries out there too happy.
>>>
>>> That is why doing it at the interceptor level is ideal.   It would
>>> be completely independent of the databinding.   Heck, you would be
>>> able to
>>> feed it a DOMSource if using a Provider<Source> type thing and the
>>> namespaces would get stripped out as well.
>>
>> I'm not sure this can be done with an interceptor.  I'd guess that,
>> client that expects messages to be namespace free are unlikely to
>> send messages with the proper namespaces in the first place.  When
>> aegis sees the xml without namespaces, it isn't going match nested
>> elements in the BeanType class to the xml elements because it matches
>> on qname.
>>
>>  From what I have seen of the BeanType code, think that you can make
>> aegis expect namespace free nested elements using a new TypeCreater
>> which creates BeanTypes with no namespace expectations.  This is how
>> the StructType works.
>>
>> Now that I think about it, I bet the javascript libraries are
>> expecting soap encoding which doesn't have namespace qualified nested
>> elements.
>>
>> -dain
>
>
>
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog


Re: suppress namespace?

Posted by Daniel Kulp <dk...@apache.org>.
Dain,

One of the main use cases for  such "namespace free" responses is for the 
REST style things where a client does a "get" on a URL and receives an 
XML response back.    The XML parsers in various toolkits (and browsers) 
don't always work well with the namespaces that JAXB and Aegis would 
always spit out.  

Most likely, you would register a service on two URL's.   One that would 
return a proper XML that is consumable by smarter clients and another 
that would have the strip interceptor setup.    You may be able to do 
something really smart in the interceptor like look at the user agent or 
something and only strip for certain agents.

Dan


On Wednesday 12 December 2007, Dain Sundstrom wrote:
> On Dec 12, 2007, at 7:55 AM, Daniel Kulp wrote:
> > On Wednesday 12 December 2007, Vespa, Anthony J wrote:
> >> I would be interested in this as well for Aegis bindings - it does
> >> not
> >> make some of the JS libraries out there too happy.
> >
> > That is why doing it at the interceptor level is ideal.   It would
> > be completely independent of the databinding.   Heck, you would be
> > able to
> > feed it a DOMSource if using a Provider<Source> type thing and the
> > namespaces would get stripped out as well.
>
> I'm not sure this can be done with an interceptor.  I'd guess that,
> client that expects messages to be namespace free are unlikely to
> send messages with the proper namespaces in the first place.  When
> aegis sees the xml without namespaces, it isn't going match nested
> elements in the BeanType class to the xml elements because it matches
> on qname.
>
>  From what I have seen of the BeanType code, think that you can make
> aegis expect namespace free nested elements using a new TypeCreater
> which creates BeanTypes with no namespace expectations.  This is how
> the StructType works.
>
> Now that I think about it, I bet the javascript libraries are
> expecting soap encoding which doesn't have namespace qualified nested
> elements.
>
> -dain



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: suppress namespace?

Posted by Dain Sundstrom <da...@iq80.com>.
On Dec 12, 2007, at 7:55 AM, Daniel Kulp wrote:

> On Wednesday 12 December 2007, Vespa, Anthony J wrote:
>> I would be interested in this as well for Aegis bindings - it does  
>> not
>> make some of the JS libraries out there too happy.
>
> That is why doing it at the interceptor level is ideal.   It would be
> completely independent of the databinding.   Heck, you would be  
> able to
> feed it a DOMSource if using a Provider<Source> type thing and the
> namespaces would get stripped out as well.

I'm not sure this can be done with an interceptor.  I'd guess that,  
client that expects messages to be namespace free are unlikely to  
send messages with the proper namespaces in the first place.  When  
aegis sees the xml without namespaces, it isn't going match nested  
elements in the BeanType class to the xml elements because it matches  
on qname.

 From what I have seen of the BeanType code, think that you can make  
aegis expect namespace free nested elements using a new TypeCreater  
which creates BeanTypes with no namespace expectations.  This is how  
the StructType works.

Now that I think about it, I bet the javascript libraries are  
expecting soap encoding which doesn't have namespace qualified nested  
elements.

-dain

Re: suppress namespace?

Posted by Daniel Kulp <dk...@apache.org>.


On Wednesday 12 December 2007, Vespa, Anthony J wrote:
> I would be interested in this as well for Aegis bindings - it does not
> make some of the JS libraries out there too happy.

That is why doing it at the interceptor level is ideal.   It would be 
completely independent of the databinding.   Heck, you would be able to 
feed it a DOMSource if using a Provider<Source> type thing and the 
namespaces would get stripped out as well.   

> Question - if you have a high traffic site, wouldn't having something
> in the interceptor chain that did this on every response have a
> performance impact?  Would it be preferable to have it at a differet
> layer?  It could be because I'm thinking of interceptors as analogous
> to servlet filters and I've seen perf issues with those under load.

Servlet filters really suck as you pretty much have to byte[] the 
response, reparse it, process it, then restream it, etc...   That's why 
there is a huge performance penalty while using them.    The interceptor 
approach would just modify the Stax events before anything is written.   
There isn't any reparsing, re-traversing the xml, reprocessing, 
restreaming, etc....     It's all done "inline".   

Basically, if I was doing it, I'd subclass the StreamWriterDelegate class 
(found in stax-utils-20060502.jar) and override all the 
writeStartElement and writeEmptyElement to call the non-namespace 
versions.   For example:

    public void writeStartElement(String namespaceURI, String localName)
        throws XMLStreamException {
        out.writeStartElement(localName);
    }
(There may need some extra code to handle/fake the NamespaceContext 
stuff.   That would require some testing and experimentation.)


The interceptor code would just be something like:

XMLStreamWriter xmlWriter = message.getContent(XMLStreamWriter.class);
message.setContent(XMLStreamWriter.class,
   new StripNamespaceWriter(xmlWriter);
message.setProperty("disable.outputstream.optimization", Boolean.TRUE);



> Any chance this would get into a build before the end of the year or
> mid Jan?

If someone steps up to do it, sure.   Seriously, the above code snipets 
are a huge starting point.   It's mostly just flush it out and test it a 
bit.  Unfortunately, I definitely don't have time right now.

Dan

>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Tuesday, December 11, 2007 5:29 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: suppress namespace?
>
>
> I created a JIRA for this:
>
> https://issues.apache.org/jira/browse/CXF-1291
>
> It's a relatively easy thing to write so it's something that someone
> that's interested getting started with digging into CXF interceptors
> could pick up.
>
> Dan
>
> On Wednesday 21 November 2007, mule1 wrote:
> > Is it possible to suppress the namespace in the response elements
> > using jaxb? I have the similar issue where customer don't want the
> > namespace in the response.
> >
> > dkulp wrote:
> > > With Aegis, defintely no right now.  :-(
> > >
> > > Aegis always generates qualified schemas so all the elements are
> > > namespace qualified.
> > >
> > > Actually, an "interesting" approach could be to add an interceptor
> > > immediately after the StaxOutInterceptor that would wrapper the
> > > XMLStreamWriter with a writer that would discard all namespace
> > > related events.
> > >
> > > Dan
> > >
> > > On Monday 12 November 2007, BrianP wrote:
> > >> Is there a way to suppress the namespace in the response?  I have
> > >> just a simple webservice set up which uses aegis.  For example,
> > >> my output is currently this:
> > >>
> > >> <list>
> > >>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
> > >>     <ns2:desc xmlns="http://services.mycompany.com">item
> > >> desc</ns2:desc> <ns2:id
> > >> xmlns="http://services.mycompany.com">1</ns2:id>
> > >>   </ns2:Item>
> > >>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
> > >>     <ns2:desc xmlns="http://services.mycompany.com">item desc
> > >> 2</ns2:desc> <ns2:id
> > >> xmlns="http://services.mycompany.com">22</ns2:id> </ns2:Item>
> > >> </list>
> > >>
> > >> And I want it to be simply this:
> > >>
> > >> <list>
> > >>   <Item>
> > >>     <desc>item desc</desc>
> > >>     <id>1</id>
> > >>   </Item>
> > >>   <Item>
> > >>     <desc>item desc2</desc>
> > >>     <id>22</id>
> > >>   </Item>
> > >> </list>
> > >
> > > --
> > > J. Daniel Kulp
> > > Principal Engineer
> > > IONA
> > > P: 781-902-8727    C: 508-380-7194
> > > daniel.kulp@iona.com
> > > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

RE: suppress namespace?

Posted by "Vespa, Anthony J" <aj...@cbs.com>.
I would be interested in this as well for Aegis bindings - it does not
make some of the JS libraries out there too happy.

Question - if you have a high traffic site, wouldn't having something in
the interceptor chain that did this on every response have a performance
impact?  Would it be preferable to have it at a differet layer?  It
could be because I'm thinking of interceptors as analogous to servlet
filters and I've seen perf issues with those under load.

Any chance this would get into a build before the end of the year or mid
Jan?

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Tuesday, December 11, 2007 5:29 PM
To: cxf-user@incubator.apache.org
Subject: Re: suppress namespace?


I created a JIRA for this:

https://issues.apache.org/jira/browse/CXF-1291

It's a relatively easy thing to write so it's something that someone 
that's interested getting started with digging into CXF interceptors 
could pick up.

Dan


On Wednesday 21 November 2007, mule1 wrote:
> Is it possible to suppress the namespace in the response elements
> using jaxb? I have the similar issue where customer don't want the
> namespace in the response.
>
> dkulp wrote:
> > With Aegis, defintely no right now.  :-(
> >
> > Aegis always generates qualified schemas so all the elements are
> > namespace qualified.
> >
> > Actually, an "interesting" approach could be to add an interceptor
> > immediately after the StaxOutInterceptor that would wrapper the
> > XMLStreamWriter with a writer that would discard all namespace
> > related events.
> >
> > Dan
> >
> > On Monday 12 November 2007, BrianP wrote:
> >> Is there a way to suppress the namespace in the response?  I have
> >> just a simple webservice set up which uses aegis.  For example, my
> >> output is currently this:
> >>
> >> <list>
> >>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
> >>     <ns2:desc xmlns="http://services.mycompany.com">item
> >> desc</ns2:desc> <ns2:id
> >> xmlns="http://services.mycompany.com">1</ns2:id>
> >>   </ns2:Item>
> >>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
> >>     <ns2:desc xmlns="http://services.mycompany.com">item desc
> >> 2</ns2:desc> <ns2:id
> >> xmlns="http://services.mycompany.com">22</ns2:id> </ns2:Item>
> >> </list>
> >>
> >> And I want it to be simply this:
> >>
> >> <list>
> >>   <Item>
> >>     <desc>item desc</desc>
> >>     <id>1</id>
> >>   </Item>
> >>   <Item>
> >>     <desc>item desc2</desc>
> >>     <id>22</id>
> >>   </Item>
> >> </list>
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: suppress namespace?

Posted by Daniel Kulp <dk...@apache.org>.
I created a JIRA for this:

https://issues.apache.org/jira/browse/CXF-1291

It's a relatively easy thing to write so it's something that someone 
that's interested getting started with digging into CXF interceptors 
could pick up.

Dan


On Wednesday 21 November 2007, mule1 wrote:
> Is it possible to suppress the namespace in the response elements
> using jaxb? I have the similar issue where customer don't want the
> namespace in the response.
>
> dkulp wrote:
> > With Aegis, defintely no right now.  :-(
> >
> > Aegis always generates qualified schemas so all the elements are
> > namespace qualified.
> >
> > Actually, an "interesting" approach could be to add an interceptor
> > immediately after the StaxOutInterceptor that would wrapper the
> > XMLStreamWriter with a writer that would discard all namespace
> > related events.
> >
> > Dan
> >
> > On Monday 12 November 2007, BrianP wrote:
> >> Is there a way to suppress the namespace in the response?  I have
> >> just a simple webservice set up which uses aegis.  For example, my
> >> output is currently this:
> >>
> >> <list>
> >>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
> >>     <ns2:desc xmlns="http://services.mycompany.com">item
> >> desc</ns2:desc> <ns2:id
> >> xmlns="http://services.mycompany.com">1</ns2:id>
> >>   </ns2:Item>
> >>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
> >>     <ns2:desc xmlns="http://services.mycompany.com">item desc
> >> 2</ns2:desc> <ns2:id
> >> xmlns="http://services.mycompany.com">22</ns2:id> </ns2:Item>
> >> </list>
> >>
> >> And I want it to be simply this:
> >>
> >> <list>
> >>   <Item>
> >>     <desc>item desc</desc>
> >>     <id>1</id>
> >>   </Item>
> >>   <Item>
> >>     <desc>item desc2</desc>
> >>     <id>22</id>
> >>   </Item>
> >> </list>
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: suppress namespace?

Posted by mule1 <ua...@yahoo.com>.
Is it possible to suppress the namespace in the response elements using jaxb?
I have the similar issue where customer don't want the namespace in the
response.



dkulp wrote:
> 
> 
> With Aegis, defintely no right now.  :-(   
> 
> Aegis always generates qualified schemas so all the elements are 
> namespace qualified.
> 
> Actually, an "interesting" approach could be to add an interceptor 
> immediately after the StaxOutInterceptor that would wrapper the 
> XMLStreamWriter with a writer that would discard all namespace related 
> events.  
> 
> Dan
> 
> 
> 
> On Monday 12 November 2007, BrianP wrote:
>> Is there a way to suppress the namespace in the response?  I have just
>> a simple webservice set up which uses aegis.  For example, my output
>> is currently this:
>>
>> <list>
>>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
>>     <ns2:desc xmlns="http://services.mycompany.com">item
>> desc</ns2:desc> <ns2:id
>> xmlns="http://services.mycompany.com">1</ns2:id>
>>   </ns2:Item>
>>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
>>     <ns2:desc xmlns="http://services.mycompany.com">item desc
>> 2</ns2:desc> <ns2:id xmlns="http://services.mycompany.com">22</ns2:id>
>> </ns2:Item>
>> </list>
>>
>> And I want it to be simply this:
>>
>> <list>
>>   <Item>
>>     <desc>item desc</desc>
>>     <id>1</id>
>>   </Item>
>>   <Item>
>>     <desc>item desc2</desc>
>>     <id>22</id>
>>   </Item>
>> </list>
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/suppress-namespace--tf4793377.html#a13889902
Sent from the cxf-user mailing list archive at Nabble.com.


Re: suppress namespace?

Posted by Daniel Kulp <dk...@apache.org>.
With Aegis, defintely no right now.  :-(   

Aegis always generates qualified schemas so all the elements are 
namespace qualified.

Actually, an "interesting" approach could be to add an interceptor 
immediately after the StaxOutInterceptor that would wrapper the 
XMLStreamWriter with a writer that would discard all namespace related 
events.  

Dan



On Monday 12 November 2007, BrianP wrote:
> Is there a way to suppress the namespace in the response?  I have just
> a simple webservice set up which uses aegis.  For example, my output
> is currently this:
>
> <list>
>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
>     <ns2:desc xmlns="http://services.mycompany.com">item
> desc</ns2:desc> <ns2:id
> xmlns="http://services.mycompany.com">1</ns2:id>
>   </ns2:Item>
>   <ns2:Item xmlns:ns2="http://services.mycompany.com">
>     <ns2:desc xmlns="http://services.mycompany.com">item desc
> 2</ns2:desc> <ns2:id xmlns="http://services.mycompany.com">22</ns2:id>
> </ns2:Item>
> </list>
>
> And I want it to be simply this:
>
> <list>
>   <Item>
>     <desc>item desc</desc>
>     <id>1</id>
>   </Item>
>   <Item>
>     <desc>item desc2</desc>
>     <id>22</id>
>   </Item>
> </list>



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog