这是我用来添加肥皂体的 java SAAJ 代码。如何将 cdata 添加为soapbody 的一部分。
// SOAP Head
SOAPHeader header = envelope.getHeader();
SOAPElement soapHeadElem = header.addChildElement("xxx");
SOAPElement soapHeadElem1 = soapHeadElem.addChildElement("xxx");
soapHeadElem1.addTextNode("xx");
// SOAP Body
SOAPBody soapBody = envelope.getBody();
// add cdata here