This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
我还遇到了 getFaultDetail() 返回 null 的问题(对于 SharePoint Web 服务)。 我可以使用与此类似的方法获取详细信息元素:
之后,您可以对返回的元素或任何您想要的内容调用 getTextContent() 。
I also had the problem that getFaultDetail() returned null (for a SharePoint web service). I could get the detail element out by using a method similar to this:
After that, you can call getTextContent() on the returned Element or whatever you want.
检查接收到 Soap Failure 时收到的 HTTP 响应类型。 当 SOAP 错误响应使用 HTTP 200 而不是 HTTP 500 时,我遇到了同样的问题。然后您会得到:
当您如下更改 WebServiceTemplate 连接故障设置时:
那么您可以正确捕获 SoapFaultClientException
Check out what type of HTTP response you get when receiving Soap Fault. I had the same problem when SOAP Fault responses using HTTP 200 instead of HTTP 500. Then you get:
When you change WebServiceTemplate connection fault settings as below:
then you can properly catch SoapFaultClientException
来自 marshalSendAndReceive 方法
看起来 catch 块中的 SoapFaultClientException 永远不会发生。
从 API 来看,确定故障详细信息的最佳选择是设置自定义 故障消息接收器。
From the Javadocs for the marshalSendAndReceive method
it looks like the SoapFaultClientException in the catch block will never happen.
From the API it looks like the best bet for determining the details of the fault is to set a custom Fault Message Receiver.