【发布时间】:2017-11-14 03:10:29
【问题描述】:
我有一个 org.springframework.ws.soap.client.SoapFaultClientException 对象。我想获取其中包含的详细信息以用于记录目的,但我发现很难确定如何执行此操作。
exception.getFaultStringOrReason() 方法会给我一个基本的错误信息。但是,我需要获取对象的故障详细信息中包含的更多详细信息。 SOAP 响应如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>soap:Client</faultcode>
<faultstring>The values from the client failed to pass validation.</faultstring>
<detail>
<Errors>
<Error reason="Required on input.">
<ErrorLocation>
<Node level="1" name="MyElement"/>
<Node level="2" name="MyField"/>
</ErrorLocation>
<Parameters/>
<StackTrace/>
</Error>
</Errors>
</detail>
</soap:Fault>
我已经遍历了许多 org.springframework.ws.soap.SoapFaultDetailElement 对象,但我无法获得其中包含的详细信息。这个可以吗?
提前感谢您的帮助
【问题讨论】: