I'm having troubles with handling Exceptions in my apache-cxf client. I'm expecting an exception that is thrown by the soap call 'Fault_Exception' but I'm always receiving the common SOAPFaultException
Generated classes:
@WebFault(name = "FaultMessage", targetNamespace = "http://a.b.c/ws/")
public class Fault_Exception extends Exception {
private a.b.c.Fault faultMessage;
....
}
and Fault is
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "fault", propOrder = {
"code",
"description",
"stack"
})
public class Fault {
...
}
soap:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>EXCEPTION</faultstring>
<detail>
<Fault xmlns:n1="http://a.b.c/ws/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://a.b.c/ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="n1:fault">
<code xmlns="http://a.b.c/ws/">error.code.1</code>
<description xmlns="http://a.b.c/ws/">some description of the error.</description>
<stack xmlns="http://a.b.c/ws/">....</stack>
</Fault>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Is there a mismatch between the generated classes and the response ? Or what else can be the problem of this? Or is it totally logic that I get a SOAPFaultException? I have no clue how to get the information (code & description) then ...
Kind regards!