Hi
On 05/09/12 18:23, sireesh wrote:
Hi,
The REST service I'm talking to doesn't like prefixes in the request xml.
But, it needs the namespace declaration.
The following request is consumed by the REST service
<AuthenticateRequest xmlns="my.namespace">
<Header xmlns="my.namespace.Core">value
</Header>
</AuthenticateRequest>
But, the request xml being generated by CXF contains namespace prefixes.
<ns3:AuthenticateRequest xmlns:ns2="my.namespace.Core"
xmlns:ns3="my.namespace">
<ns2:Header xmlns="my.namespace.Core">value
</ns2:Header>
</ns3:AuthenticateRequest>
Can someone please help me how I can remove the prefixes from the marshalled
xml.
I tried using TransformOutInterceptor, dropping the elements as below, but
it doesn't work.
List<String> dropElements = Collections.singletonList("*");
transformOutInterceptor.setOutDropElements(dropElements);
final ClientConfiguration config =
WebClient.getConfig(authenticationClient);
config.getOutInterceptors().add(transformOutInterceptor);
dropElements is for dropping the actual elements, try
'outTransformElements', ex:
{http://mynamespace}MyElement:MyElement
Cheers, Sergey
Thanks,
Sireesh
--
View this message in context:
http://cxf.547215.n5.nabble.com/Remove-namespace-prefixes-in-JAX-RS-tp5713618.html
Sent from the cxf-user mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com