cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: XML/HTTP with NO namespaces!
Date Wed, 01 Sep 2010 18:14:29 GMT

With the JAX-WS related things, there really is not a way to do it.   Per 
spec, if a namespace is not specified, we have to map the package into the 
namespace and set that on the schema.   Thus, the resulting XML would at least 
have the root node qualified.    That would be proper per spec.

You could "fake" it by writing an interceptor that would wrapper the 
XMLStreamReader and strip off the namespace (or add it for a POST to make it 
match the expected input), but not really "per spec".

For the JAX-RS stuff, the rules are different and Sergey's response would 
point to the correct location.

Dan


On Wednesday 01 September 2010 3:27:28 am Milisic Aleksandar wrote:
> Hi,
> 
> I am trying to consume an XML over HTTP service which does not understand
> the concept of namespaces and I am using the JaxWsProxyFactoryBean class
> for that. Also, the names of fields of both request and response can be
> identical. The default binding implementation relies on the JAXB framework
> and the framework cannot expose a web service properly (the
> factory.create() throws an exception “Two classes have the same XML type
> name "{http://company.blabla /}individual-nameType". Use @XmlType.name and
> @XmlType.namespace to assign different names to them at this point
> JAXBContext.newInstance(classes.toArray(new Class[classes.size()]), map);)
> unless I specify namespaces to calm down JAXB.
> 
> 
> Could anyone possibly recommend the desirable approach:
> 
> 1.      Create a custom interception which would erase namespace specific
> information before the request gets submitted along the chain.
> 2.      Create a custom DataBinging class and inherit it from
> AbstractDataBinding
> 3.      Do anything else to get it done.
> 
> Any suggestion would be greatly appreciated.
> 
> Kind regards,
> 
> Aleks

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

Mime
View raw message