axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Accessing faultstring in Axis2 client
Date Wed, 04 Jun 2014 19:42:25 GMT

//assume you have access to soapFault
 String text = soapFault.getFaultString();

Date: Wed, 4 Jun 2014 11:34:10 -0700
Subject: Re: Accessing faultstring in Axis2 client

 The AxisFault class is not available here.  If so, it would be trivial.  Only the defined
response OR an exception is returned (see code below).  Is there any way to get the faultstring?
      On Wednesday, June 4, 2014 11:19 AM, Martin Gainty <> wrote:**     * Dump the fault info to the log at debug level.     */    public
void dump() {        log.debug(dumpToString());    }    /**     * turn the fault and details
into a string, with XML escaping.     * subclassers: for security (cross-site-scripting) reasons,
    * escape everything that could contain caller-supplied data.     * @return stringified
fault details     */    public String dumpToString()> Date: Wed, 4 Jun 2014 06:18:42 -0700>
From:> Subject: Accessing faultstring in Axis2 client>
To:> > I have a simple question - how do I access the SOAP
faultcode and faultstring in an Axis2 client?> > The client code calls the web service
operation and returns the response or throws an exception:>  > try {> stub.getPublication(pub,
auth);> }> catch (WebServiceException wse) {> wse.printStackTrace();> }>  >
I need to get the text in the
 <faultstring> element.  How do I do that?>  > Many thanks.> J> 
View raw message