将流结果转换为字符串或 xml
2022-09-01 06:39:27
使用弹簧 ws 获取 StreamResult,如下所示
StreamSource source = new StreamSource(new StringReader(MESSAGE));
StreamResult result = new StreamResult(System.out);
webServiceTemplate.sendSourceAndReceiveToResult("http://someUri",
source, new SoapActionCallback("someCallBack"), result);
return result;
我得到了结果,但我想将其提取到某种xml甚至字符串中(只想查看内容以生成响应)。
我该怎么做?