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