유효한 비누 요청 (wsimport를 통해 생성 된 클래스)에 대한 요청 및 응답을 성공적으로 기록 할 수 있지만 예외가 발생하면 (요청의 노드가 유효하지 않은 데이터로 채워질 때) XML 내용을 캡처 할 수 없습니다. 응답의 세부 사항을 얻을 수 있지만 원시 응답의 xml 부분 만 캡처하려고합니다. SOAPFaultException 시도했다 그러나 그 예외/오류가 throw 된 XML 콘텐츠를 사용하여 예외를 캡처 할 response.How 본문 전체 봉투 대신 메시지 대신 예외 만 제공합니다.요청에 잘못된 데이터에 대한 비누 오류 응답을 캡처하는 방법은 무엇입니까?
참고 : 오류 (원시 응답)를 구문 분석하고 XML 콘텐츠를 가져올 수 있지만 아래의 XML 콘텐츠를 가져 오는 간단한 방법/방법이 있는지 궁금합니다. 내용은 (비누 UI 도구에서 캡처 한 응답) 더 탐구하고 시도 후
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
<wsa:MessageID>urn:uuid:xyz</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:xyz</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
</env:Header>
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Sender</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">The 'http://www.fakexyz.com/schemas/xyz:xyz' element is invalid - The value '123' is invalid according to its datatype 'String' - The Pattern constraint failed.
Please revise your data fields and make sure that message is correctly formatted.</soap:Text>
</soap:Reason>
<detail>
<faulttype>Schema</faulttype>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>