怎样将soapmessage 转为string
2015-07-21 · 知道合伙人软件行家
关注
展开全部
楼主,你好,可以参考如下代码:
// 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());
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询