On Sun February 22 2009 11:37:27 pm virtualshock wrote:
> I need to modify the <SOAP:Body> tag on an outgoing message.  I am making a
> call to a very non-standard service that requires an attribute to be set in
> the <SOAP:Body> tag.  I have looked at some of the various Out interceptors
> that are used in CXF but I haven't found an example of what I am looking
> for.  Does anyone have any suggestions on where to look for a good example
> of modifying document before it gets sent out?  Thanks

There are three ways to do this:

1) Use a JAXWS handler and manipulate the SAAJ model

2) Stick the SAAJOutInterceptor on the out chain and manipulate the SAAJ model

3) Stick an interceptor on the chain immediately AFTER the SoapOutInterceptor 
that grabs the XMLStreamWriter from the message and just calls:
xmlwriter.writeAttribute(.....);
to write the attribute onto the body.     The last thing SoapOutInterceptor is 
calls writeStartElement for the soap:body so you can add attributes to it at 
that point.

(3) is definitely the highest performing solution.


-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to