You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ge...@gmail.com, ge...@gmail.com on 2018/08/07 14:08:42 UTC

CXF adding all unused namespaces from wsdl into request

Hi,
 
we are facing an issue where our web services requests are getting "Fault error" response because of additional unused namespaces were sent the request.

Can anyone know how we can make cxf ignore to add the unused namespaces into request ?

Thanks
Geetha

Re: CXF adding all unused namespaces from wsdl into request

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

> On Aug 7, 2018, at 10:08 AM, geetha.kadhiri@gmail.com wrote:
> we are facing an issue where our web services requests are getting "Fault error" response because of additional unused namespaces were sent the request.
> 
> Can anyone know how we can make cxf ignore to add the unused namespaces into request ?


This isn’t really CXF doing this, it’s JAXB.   JAXB doesn’t walk the entire object tree to determine which namespaces it needs for that marshal, it just writes out all the namespaces and then uses those while marshaling.

I BELIEVE (not 100% positive) that if you generate the code without the package annotations, then jaxb won’t output the namespaces until needed.    For wsdl2java that would be adding the -xjc-npa flag. However, the size of the messages may go up if it needs to output the same namespace multiple times.    


-- 
Daniel Kulp
dkulp@apache.org <ma...@apache.org> - http://dankulp.com/blog <http://dankulp.com/blog>
Talend Community Coder - http://talend.com <http://coders.talend.com/>