Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Jack Sprat
Andreas,   Thanks for pointing me in the right direction.  Below is what worked for me. SOAPFault fl = cl.getLastOperationContext().getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE ).getEnvelope().getBody().getFault(); String faultstring = fl.getReason().getText(); Thanks, J   On Friday,

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Jack Sprat
Andreas,   How do I get the SOAP fault using the ServiceClient? Thanks, Todd   On Friday, June 6, 2014 10:56 AM, Jack Sprat wrote:   Yes, it does extend the org.apache.axis2.client.Stub class. On Friday, June 6, 2014 10:36 AM, Andreas Veithen wrote: Does it have a _getServiceClient() meth

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Andreas Veithen
In that case, you can use the _getServiceClient() method to get the ServiceClient. From there you will be able to get to the last OperationContext and from there to the MessageContext with the response. Andreas On Fri, Jun 6, 2014 at 3:55 PM, Jack Sprat wrote: > > Yes, it does extend the org.apa

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Jack Sprat
  Yes, it does extend the org.apache.axis2.client.Stub class. On Friday, June 6, 2014 10:36 AM, Andreas Veithen wrote: Does it have a _getServiceClient() method (i.e. does it extend org.apache.axis2.client.Stub)? Andreas On Fri, Jun 6, 2014 at 3:29 PM, Jack Sprat wrote: > Andreas, > > Tha

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Jack Sprat
I am using Axis2 version 1.6.1. I am not using the ServiceClient class.  I was able to get to the fault by manually constructing a SOAPEnvelope object but this is not ideal. Thanks, J   On Friday, June 6, 2014 10:35 AM, satyapriya sahoo wrote: What version of Axis2 you are using.  What ev

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Andreas Veithen
Does it have a _getServiceClient() method (i.e. does it extend org.apache.axis2.client.Stub)? Andreas On Fri, Jun 6, 2014 at 3:29 PM, Jack Sprat wrote: > Andreas, > > Thanks very much for the reply. I don't see any methods in the stub class to > get the message context. There are many "toOM"

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread satyapriya sahoo
What version of Axis2 you are using. What ever code I have given is the working code only. I am using axis2-1.5.1. The axis fault belongs to bellow package org.apache.axis2.AxisFault Thanks, Satya On Fri, Jun 6, 2014 at 7:59 PM, Jack Sprat wrote: > Andreas, > > Thanks very much for the repl

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Jack Sprat
Andreas,   Thanks very much for the reply.  I don't see any methods in the stub class to get the message context.  There are many "toOM" methods that convert an object to an OMElement object.   I am using XMLBeans binding.   Thanks, J    On Friday, June 6, 2014 8:10 AM, Andreas Veithen wrote:

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Jack Sprat
Thanks for the reply but, again, the AxisFault is not available here.  Here is the code snippet again. try{   stub.getPublication(pub, auth); } catch(PublicationException pe) { // AxisFault is not available here! } Thanks, J  On Friday, June 6, 2014 6:30 AM, satyapriya sahoo wrote: I thi

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread Andreas Veithen
IIRC, the stub has a method to access the (last) message context. From there you should be able to get to the response message and extract the SOAP fault. Andreas On Thu, Jun 5, 2014 at 2:43 PM, Jack Sprat wrote: > There is a method in the Exception class named #getFaultMessage. This > returns

Re: Accessing faultstring in Axis2 client

2014-06-06 Thread satyapriya sahoo
I think the bellow code will help you. try{ //Client code }catch(AxisFault af){ if(af!=null){ * RemoteException re = af;* * Throwable th = re.detail;* * String faultMsg = th.toString();* System.out.println("FaultString :: "+faultMsg ); } } I know this is

Re: Accessing faultstring in Axis2 client

2014-06-05 Thread Jack Sprat
There is a method in the Exception class named #getFaultMessage.  This returns blank, which is correct since there is no text in the exception.  It would be very easy if this was the answer.   I need to get the faultstring.  The faultstring is outside the exception.  See the XML snippet below.  

Re: Accessing faultstring in Axis2 client

2014-06-04 Thread satyapriya sahoo
Jack, Hope bellow points will help you to solve your Problem. You can process in 3 ways. 1) IN your client code you need an catch block for AxisFault and U need to retrieve the message from that exception try{ //Client code }catch(AxisFault af){ if(af!=null){ String faultMsg = af.

Re: Accessing faultstring in Axis2 client

2014-06-04 Thread Jack Sprat
: Wed, 4 Jun 2014 11:34:10 -0700 From: [email protected] Subject: Re: Accessing faultstring in Axis2 client To: [email protected]  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

RE: Accessing faultstring in Axis2 client

2014-06-04 Thread Martin Gainty
//assume you have access to soapFault String text = soapFault.getFaultString(); M- Date: Wed, 4 Jun 2014 11:34:10 -0700 From: [email protected] Subject: Re: Accessing faultstring in Axis2 client To: [email protected] The AxisFault class is not available here. If so, it

Re: Accessing faultstring in Axis2 client

2014-06-04 Thread Jack Sprat
 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?   Thanks, J   On Wednesday, June 4, 2014 11:19 AM, Martin Gainty wrote:     AxisFault.java /** * D

RE: Accessing faultstring in Axis2 client

2014-06-04 Thread Martin Gainty
AxisFault.java /** * 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, *