我正在尝试调用一些 WS。我的本地计算机上有服务器和客户端。我 100% 确定消息内容,并且它从服务器发送到客户端,没有任何更改。问题是客户端创建的 SOAPMessage
对象不正确,soapPart 下的信封字段等于 null。
客户端代码:
SOAPMessage responseMsg = conn.call(msg, urlEndpoint);
服务器端代码:
SOAPEnvelope envelope = sp.getEnvelope();
SOAPHeader hdr = envelope.getHeader();
SOAPBody bdy = envelope.getBody();
bdy.addBodyElement(envelope.createName("response", "soa", "http://www.sbg.com"));
return msg;
在调试窗口中我看到以下内容:
1) 服务器端调试窗口
2) 客户端调试窗口
我使用 SAAJ 进行通信,并使用 JDK 1.6。
有人可以协助解决这个问题吗?
最佳答案
关于java - SOAPMessage 对象中的信封字段为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13973875/