我想在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 ?
....
}