代码片段

// 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());

 

相关文章: