soap问题 很急
// 创建连接
// ==================================================
SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnFactory.createConnection();
// 创建消息对象
// ===========================================
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
// message.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "gb2312");
// 创建soap消息主体==========================================
SOAPPart soapPart = message.getSOAPPart();// 创建soap部分
SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPHeader soapHeader = envelope.getHeader();
SOAPBody body = envelope.getBody();
// 根据要传给mule的参数,创建消息body内容。具体参数的配置可以参照应用集成接口技术规范1.1版本
// =====================================
SOAPElement bodyElement = body.addChildElement(envelope.createName("LotteryBalanceQuery", "m", "http://LotteryBalanceQuery.tydic.com"));
SOAPElement bodyElement1 = bodyElement.addChildElement("in0");
SOAPElement bodyElement2 = bodyElement1.addChildElement("entry");
SOAPElement bodyElement3 = bodyElement1.addChildElement("entry");
SOAPElement bodyElement4 = bodyElement1.addChildElement("entry");
bodyElement2.addChildElement("key").addTextNode("nStaffId");
bodyElement2.addChildElement("value").addTextNode("100097");
bodyElement3.addChildElement("key").addTextNode("nLantId");
bodyElement3.addChildElement("value").addTextNode("551");
bodyElement4.addChildElement("key").addTextNode("sServiceNbr");
bodyElement4.addChildElement("value").addTextNode("15305510283");
// Save the message
message.saveChanges();
// 打印客户端发出的soap报文,做验证测试
message.writeTo(System.out);
最后一句报错 不知道什么原因