如何把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());

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/68988.html