HNT
HNT

Reputation: 147

How to modify the content of message CXF in interceptors

I want to add some informations in content of an outbound message cxf at an OutInterceptor of client and remove these informations at an InInterceptor of Server.

How i can do it ?

Regards.

Upvotes: 2

Views: 5863

Answers (1)

Mahesh Biradar
Mahesh Biradar

Reputation: 391

If you want to add soap header and process it then go for org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor implementation with SETUP as phase for outbound and READ for inbound.

If you want to change some content of outgoing XML itself then you can play around with Abstract steam interceptor and org.apache.cxf.io.CachedOutputStream

Please take a look at

http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/interceptor/StreamInterceptor.java?revision=1173027&view=markup

and full working example @ http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/configuration_interceptor

Stack Over flow example Thrad-

How To Modify The Raw XML message of an Outbound CXF Request?

Upvotes: 2

Related Questions