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
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
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
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
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,
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
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
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 sahoo.satyapr...@gmail.com
wrote:
What version of
Yes, it does extend the org.apache.axis2.client.Stub class.
On Friday, June 6, 2014 10:36 AM, Andreas Veithen andreas.veit...@gmail.com
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
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
rexclaim...@yahoo.com.invalid wrote:
Andreas,
How do I get the SOAP fault using the ServiceClient?
Thanks,
Todd
On Friday, June 6, 2014 10:56 AM, Jack Sprat rexclaim...@yahoo.com.INVALID
wrote:
Yes, it does extend the org.apache.axis2.client.Stub class.
On Friday, June 6, 2014 10:36 AM, Andreas Veithen
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
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 =
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.
,
* 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: rexclaim...@yahoo.com.INVALID
Subject: Accessing faultstring in Axis2 client
To: java-user@axis.apache.org
everything that could contain caller-supplied data.
* @return stringified fault details
*/
public String dumpToString()
Date: Wed, 4 Jun 2014 06:18:42 -0700
From: rexclaim...@yahoo.com.INVALID
Subject: Accessing faultstring in Axis2 client
To: java-user@axis.apache.org
I have
//assume you have access to soapFault
String text = soapFault.getFaultString();
M-
Date: Wed, 4 Jun 2014 11:34:10 -0700
From: rexclaim...@yahoo.com.INVALID
Subject: Re: Accessing faultstring in Axis2 client
To: java-user@axis.apache.org
The AxisFault class is not available here. If so
16 matches
Mail list logo