Hi,
I got a little problem with receiving an AxisFault.
I communicate with a web service I don't have access to. So, I'm just
building a client with Axis2 and RAMPart. Data binding is xmlbeans and
RAMPart seems to work. This is my call:
[CODE]
PutMessageResponseDocument response = stub.putMessage(putMessageDocument,
payloadManifestDocument, id);
[/CODE]
And I receive an AxisFault:
[CODE]
catch (AxisFault ex) {
System.err.println("AxisFault!");
System.err.println("Message: " + ex.getMessage());
System.err.println("Fault Code: " + ex.getFaultCode());
System.err.println("Details: " + ex.getDetail());
if (ex.getFaultMessageContext() != null) {
System.err.println("Envelope: " +
ex.getFaultMessageContext().getEnvelope().toString());
}
[/CODE]
My problem is, that I don't get the contents of the fault without editing
the source code of the stub (which I don't want to do). So, I just get the
following output:
[OUTPUT]
AxisFault!
Message: error: The document is not a PutMessageResponse@
http://www.foo.de/foo: document element mismatch got Fault@
http://schemas.xmlsoap.org/soap/envelope/
Fault Code: null
Details: null
[/OUTPUT]
If I do edit the stub to print out the received message, I get:
[SOAP]
Security things
...
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Relationship not exists</faultstring>
<detail><ErrorMessage>Blablabla</ErrorMessage></detail>
</soapenv:Fault>
</soapenv:Body>
</soap:Envelope>
[/SOAP]
And that is what I want to have in my Exception handling. I know that it's a
fault and NOT a PutMessageDocument, but the "stub.putMessage() method
returns a PutMessageDocument...and not a fault. How do I get the content of
the fault?
Thank you in advance.
Best regards.