You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Gul Onural <on...@nortel.com> on 2007/04/05 04:35:13 UTC

How to check soap fault on the client side using xmlbeans client stub functions

Hi,

I have used xmlbeans databinding to generate client stubs. I am trying
to understand how to get soap fault using the client stubs.
One of my methods on the web service either returns an error (soap
fault) or a piece of information if the result is successful.

In the case of successful result, I know how to retrieve data from the
result :
       CreateXXResponseDocument resp = stub.createXX(requestDoc);

How do I know the returned response is a soap fault, programmatically ? 

I checked the xmlbeans example in the axis2 distro, but the code there
doesn't show how to handle
Custom SOAP faults dent by the web service ?

Gul



RE: How to check soap fault on the client side using xmlbeans client stub functions

Posted by Gul Onural <on...@nortel.com>.
More specifically I am looking for a way to get <faultstring> on the
client side using the xmlbeans generated stubs.
I can get <tns:errorId> (below), but I don't see any method on the
exception to allow me to retrieve <faultstring>.
 
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/> ">
  <soapenv:Header />
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode>soapenv:Client</faultcode>
      <faultstring>Something bad happened</faultstring>
      <detail>
        <tns:MySpecificFault xmlns:tns=http://www.mycompany.com/
<http://www.mycompany.com/> >
          <tns:errorId>5</tns:errorId>
        </tns:MySpecificFault>
      </detail>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>

________________________________

From: Onural, Gul (CAR:QT00) 
Sent: Wednesday, April 04, 2007 10:35 PM
To: axis-user@ws.apache.org
Subject: How to check soap fault on the client side using xmlbeans
client stub functions




Hi, 

I have used xmlbeans databinding to generate client stubs. I am trying
to understand how to get soap fault using the client stubs.

One of my methods on the web service either returns an error (soap
fault) or a piece of information if the result is successful.

In the case of successful result, I know how to retrieve data from the
result : 
       CreateXXResponseDocument resp = stub.createXX(requestDoc); 

How do I know the returned response is a soap fault, programmatically ? 

I checked the xmlbeans example in the axis2 distro, but the code there
doesn't show how to handle 
Custom SOAP faults dent by the web service ? 

Gul