我得到这个异常是因为响应是 soapFault。有没有选项我可以从这个异常中获得整个 xml 响应?我需要这个,因为此 xml inst 的重要内容在 ex.getFaultStringOrReason()
中,但作为此 xml 末尾的注释
最佳答案
ex.getSoapFault().getSource()
将为您提供一个 Source
,然后您可以手动检查或编码。
(例如,使用 TransformerFactory.newInstance().newTransformer().transform(source, new StringResult()
然后在 StringResult 上调用 toString()
)
关于java - 如何从 SoapFaultClientException 获取整个 xml 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8849159/