我正在获得toEnvelope
方法的价值。当我尝试阅读axisclient(WS client)
时
得到null
值。
System.out.println("toEnvelope :"+param.getOTA_VehCancelRSSequence_type0().getVehCancelRSCore().getUniqueID().getID());
org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
请帮我解决这个问题
答案 0 :(得分:0)
您可以使用客户端的getLastOperationContext()
方法获取最后一个OperationContext。
对于外发邮件:
OperationContext operationContext = stub._getServiceClient().getLastOperationContext();
if (operationContext != null) {
MessageContext outMsgContext = operationContext.getMessageContext("Out");
if (outMsgContext != null) {
System.out.println("Out SOAP Message : "+outMsgContext.getEnvelope().toString());
}
}
对于收到的消息:
OperationContext operationContext = stub._getServiceClient().getLastOperationContext();
if (operationContext != null) {
MessageContext inMsgContext = operationContext.getMessageContext("In");
if (inMsgContext != null) {
System.out.println("Received SOAP Message: "+ inMsgContext.getEnvelope().toString());
}
}