You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2009/07/14 23:34:11 UTC

JAXB and DOM

If someone just wants to pass arbitrary XML out of a JAX-WS+JAXB
service, what do they use for a return type? org.w3c.dom.Document?
JAXBElement?

Re: JAXB and DOM

Posted by Lukasz Lichota <Lu...@sabre.com>.
If that's arbitrary XML then maybe @WebServiceProvider is a better choice?


dkulp wrote:
> 
> On Tue July 14 2009 5:34:11 pm Benson Margulies wrote:
>> If someone just wants to pass arbitrary XML out of a JAX-WS+JAXB
>> service, what do they use for a return type? org.w3c.dom.Document?
>> JAXBElement?
> 
> Usually org.w3c.dom.Element, but out of a webservice method might be
> tough.  I 
> THINK you would need to create the proper wrapper class as you would also
> need 
> to add an @XmlAnyElement(lax="false") attribute to the field.    If it's a 
> field in another JAXB bean, it's just a Element with that annotation.
> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/JAXB-and-DOM-tp24488212p24512484.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: JAXB and DOM

Posted by Daniel Kulp <dk...@apache.org>.
On Tue July 14 2009 5:34:11 pm Benson Margulies wrote:
> If someone just wants to pass arbitrary XML out of a JAX-WS+JAXB
> service, what do they use for a return type? org.w3c.dom.Document?
> JAXBElement?

Usually org.w3c.dom.Element, but out of a webservice method might be tough.  I 
THINK you would need to create the proper wrapper class as you would also need 
to add an @XmlAnyElement(lax="false") attribute to the field.    If it's a 
field in another JAXB bean, it's just a Element with that annotation.


-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog