I am very new to Apache CXF and I am stuck with the issue of removing namespace from the SOAP message that I receive from the external server (I am serving as a client for consuming the service)
The stubs that are generated from the wsdl have a different namespace in the @WebResult while the SOAP envelope which is received from the server system is different. I want to apply a generic solution so as to remove the namespace from the response message so the client validation does not fail.
o.a.c.p.PhaseInterceptorChain - Interceptor for {http://www.abc.xyz/webservices/facade}service#{http://www.abc.xyz/webservices/facade}serviceName has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unexpected element {http://www.abc.xyz/webservices/facade}serviceResponse found. Expected {http:// www.abc.xyz/webservices/facade/xxx}serviceResponse.
Kindly help.
Solutions tried till now :
(CXF Transformation Feature)
Map<String, String> inTransformMap = Collections.singletonMap("{http:// www.abc.xyz/webservices/facade/**xxx**}serviceResponse", "");
org.apache.cxf.interceptor.transform.TransformInInterceptor transformInInterceptor = new org.apache.cxf.interceptor.transform.TransformInInterceptor();
transformInInterceptor.setInTransformElements(inTransformMap);
proxy.getInInterceptors().add(transformInInterceptor);
In this approach, when I try to replace {http://www.abc.xyz/webservices/facade/**xxx**}serviceResponse
with ""
, server hangs and it goes into infinite loop at org.apache.cxf.staxutils.transform.InTransformReader.handleDeepDrop() line 266