Hi,
Your code should be like
public void handleMessage(Message message) throws Fault {
InputStream is = message.getContent(InputStream.class);
if (is != null) {
CachedOutputStream bos = new CachedOutputStream();
try {
IOUtils.copy(is, bos);
bos.flush();
is.close();
bos.close();
String soapMessage = new String(bos.getBytes());
//change this soapMesage what ever you want and set as message
Content
} catch (IOException e) {
throw new Fault(e);
}
}
}
NOTE, this interceptor will impact the performance as it break the stream
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042
On 2012-10-19, at 下午5:11, Crack_David wrote:
> Thanks for your help!
> I've added an interceptor in thereceive-Phase but sadly the message-object
> doesn't contain my XML-Stream. Is this the wrong interceptor-phase or do I
> have to do something more?
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/java-lang-IndexOutOfBoundsException-in-processing-tp5716948p5716990.html
> Sent from the cxf-user mailing list archive at Nabble.com.