为什么出站肥皂请求为空何时处理PRE_STREAM阶段的消息?

时间:2017-08-18 08:23:59

标签: soap cxf handle outbound

我想在Pre_stream阶段处理肥皂信息。但是我不能得到肥皂信息。此外,此请求将发送大小为1 mb的字节数据。

    public class MessageChangeInterceptor extends AbstractPhaseInterceptor<SoapMessage> {



        public MessageChangeInterceptor() {
        super(Phase.PRE_STREAM);

        addBefore(SoapPreProtocolOutInterceptor.class.getName());
        }

        public void handleMessage(SoapMessage message) {
boolean isOutbound = false;
        isOutbound = message == message.getExchange().getOutMessage() || message == message.getExchange().getOutFaultMessage();

        if (isOutbound) {
                OutputStream os = message.getContent(OutputStream.class);

                CachedStream cs = new CachedStream();
                message.setContent(OutputStream.class, cs);

                message.getInterceptorChain().doIntercept(message);

                try {
                cs.flush();
                IOUtil.closeQuietly(cs);
                CachedOutputStream csnew = (CachedOutputStream) message.getContent(OutputStream.class);

                String currentEnvelopeMessage = IOUtil.toString(csnew.getInputStream(), "UTF-8");// currentEnvelopeMessage is empty ?
            ....    
        }

0 个答案:

没有答案