cxf实现的拦截器因为webservice返回报文太长无法拿到数据
以下OutInterceptor拦截器代码部分实现,因为webservice返回报文太长,导致数据无法回写到流中,无法拿到返回报文,最终xml = IOUtils.toString(in); 为null,求大大们帮忙解决啊。。。
//获取接口返回信息
OutputStream os = message.getContent(OutputStream.class);
CachedStream cs = new CachedStream();
message.setContent(OutputStream.class, cs);
message.getInterceptorChain().doIntercept(message);
CachedOutputStream csnew = (CachedOutputStream) message
.getContent(OutputStream.class);
InputStream in = csnew.getInputStream();
//获取返回报文
xml = IOUtils.toString(in);
//解析返回报文
Document document = DocumentHelper.parseText(xml);