Tôi đang gọi một webservice SOAP bằng cách sử dụng JAX WS 2.0. Trong trường hợp lỗi Tôi nhận được câu trả lời sau đây:SOAPFaultException.getFault(). GetDetail() là null
<?xml version="1.0"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://www.w3.org/2003/05/soap- envelope">
<soap:Header/>
<soap:Body>
<soap:Fault xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://www.w3.org/2003/05/soap- envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Exception of type 'blah blah' was thrown.
</soap:Text>
</soap:Reason>
<soap:Node>{SOME URL}</soap:Node>
<detail>
<error>345</error>
<message>Cannot find user. Blah blah</message>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Như bạn có thể thấy lỗi hữu ích là trong nút chi tiết:
<soap:Envelope>
<soap:Body>
<soap:Fault>
<detail>
trong khách hàng của tôi Tôi nhận được một SOAPFaultException trong đó có một Đối tượng SOAPFault. Đối tượng SOAPFault dường như thiếu nút tôi đã đăng ở trên. SOAPFaultException.getFault(). GetDetail() là null. Tuy nhiên, nó có tất cả các nút khác bao gồm cả xà phòng: Lý do. Bất kỳ ý tưởng tại sao nó thiếu nút chi tiết?
Cảm ơn.