The best bet is to take a look at the source for the Logging interceptors and 
see what they are doing.     Maybe use those as a start.

Dan


On Thursday, November 17, 2011 2:29:44 PM David Karlsen wrote:
> I do this to retrieve the request and response to/from my service:
> 
> final InputStream inputStream =
> message.getExchange().getInMessage().getContent( InputStream.class );
>                 inputStream.reset();
> 
>                 CacheAndWriteOutputStream cachedOutputStream =
> (CacheAndWriteOutputStream)
> message.getExchange().getOutMessage().getContent( OutputStream.class
> );
> 
> 
> this used to work - but somewhere in the line it started to fail with:
> java.lang.ClassCastException:
> org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream
> incompatible with org.apache.cxf.io.CacheAndWriteOutputStream
>         at xxx.MyInterceptor.handleMessage
> 
> 
> AbstractHTTPDestination$WrappedOutputStream is not available outside the
> class. AbstractWrappedOutputStream does not provide a getInputStream()
> method.
> 
> Please advice me how to obtain the requests/responses either as a
> stream or as a String.
> 
> Is my current approach OK?
> 
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to