我正在使用 Spring WS 来调用 XML Web 服务。当我尝试在 WebServiceMessageCallback 的 doWithMessage 方法中检查“消息”时,我得到“消息无法解析为变量”。该代码确实可以编译,但似乎没有记录消息。
this.webserviceTemplate.sendSourceAndReceiveToResult(source,
new WebServiceMessageCallback() {
@Override
public void doWithMessage(WebServiceMessage message)
throws IOException, TransformerException {
if (LOG.isDebugEnabled()) {
// log the SOAP request
ByteArrayOutputStream out = new ByteArrayOutputStream();
message.writeTo(out);
LOG.debug("SOAP Request Payload: " + new String(out.toByteArray()));
}
}
}, result);