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 <rexclaim...@yahoo.com.invalid> 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" 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 < > andreas.veit...@gmail.com> wrote: > 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 > <rexclaim...@yahoo.com.invalid> wrote: > > 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. > > > > I'm working on a different way of sending the request and capturing the > > response. There is a lot more coding involved but appears to be the only > > way to get the faultstring element. > > > > Thanks, > > J > > > > > > > > > > On Thursday, June 5, 2014 2:37 AM, satyapriya sahoo > > <sahoo.satyapr...@gmail.com> wrote: > > > > 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.getMessage(); > > System.out.println("FaultString :: "+faultMsg ); > > } > > } > > > > 2) If it is coming as a string, then you can do some String operation. > > > > 3) You can also take the help of dom parser or sax parse to retrieve the > > specific value, because it is coming as a xml format. > > > > Thanks, > > Satya > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org > For additional commands, e-mail: java-user-h...@axis.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org > For additional commands, e-mail: java-user-h...@axis.apache.org > >