There seems to be a bug in CXF. I think I am seeing the same issue.
I'll have to look into it a little more.

A quick workaround to make your broken client talk to the server is to
use CXF's transform feature. See
http://cxf.apache.org/docs/transformationfeature.html#TransformationFeature-Changinginputandoutputelementnamesandnamespaces

You will need to configure this feature at your client to drop the
namespace from the namespaced element for the outbound and to add the
namespace back to the non-namesapced element for the inbound.

regards, aki


2015-04-23 18:00 GMT+02:00 Vladimir Sutskever <[email protected]>:
> Hi,
>
> I am using cxf client to consume a web-service that has targetNamespace="" in 
> the WSDL's XSD definition.
> The CXF client seems to append a namespace of ns2 to the each request as 
> shown below.
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>  <soap:Body>
> <ns2:ReadSubscriberRequest 
> xmlns:ns2="http://www.x.com/TFProvisioning/";><http://www.openet.com/TFProvisioning/";>>
>            <SubscriberId>9999</SubscriberId>
>         </ns2:ReadSubscriberRequest>
>  </soap:Body>
> </soap:Envelope>
>
> Why does cxf add ns2 namespace?
> The ns2 namespace is unfamiliar to soap-service and therefore it throws an 
> fault: Cannot find the declaration of element 'ns2:ReadSubscriberRequest'
>
> How do I prevent cxf from adding a ns2 namespace reference in a case when the 
> wsdl doesn't have a targetNamespace?
>
>
> -Vladimir

Reply via email to