如何从 SoapFaultClientException 获取整个 xml 响应
我收到此异常是因为响应是soapFault。有没有选项可以让我从此异常中获取完整的 xml 响应?我需要这个,因为此 xml 的重要内容安装在 ex.getFaultStringOrReason()
中,但作为此 xml 末尾的注释
I get this exception because response is soapFault. Is there options how I can get whole xml response from this exception ? I need this because important content of this xml inst in ex.getFaultStringOrReason()
but as comment at the end of this xml
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ex.getSoapFault().getSource()
将为您提供一个Source
,然后您可以手动检查或编组。(例如,使用 TransformerFactory.newInstance().newTransformer().transform(source, new StringResult() ),然后在 StringResult 上调用
toString()
)ex.getSoapFault().getSource()
will give you aSource
which you can then inspect manually or marshall.(e.g. with
TransformerFactory.newInstance().newTransformer().transform(source, new StringResult()
then calltoString()
on the StringResult)