[Java]如何把Soap Message装成一个String对象
代码片段
// Create transformer TransformerFactory tff = TransformerFactory.newInstance(); Transformer tf = tff.newTransformer(); // Get reply content Source source = soapMessage.getSOAPPart().getContent(); ByteArrayOutputStream bos = new ByteArrayOutputStream(length); StreamResult result = new StreamResult(bos); tf.transform(source, result); resp = new String(bos.toByteArray());