I have a code which is java wrapper around a web service, on exception it throws an AxisFault exception ( as given below)
org.apache.axis2.AxisFault: Policy enforcement failed to authenticate the request.
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:446)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.tibco.n2.de.services.EntityResolverServiceStub.lookupUser(EntityResolverServiceStub.java:261)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
and the code looks like as given below,
try {
lookupUserResponse = myIntializedObject.lookupUser("someuser", null, null, true);
} catch (InvalidServiceRequestFault e) {
// TODO Auto-generated catch block
//e.printStackTrace();
} catch (InternalServiceFault e) {
// TODO Auto-generated catch block
//e.printStackTrace();
} catch (SecurityFault e) {
// TODO Auto-generated catch block
//e.printStackTrace();
}
finally{
if(lookupUserResponse==null)
return false;
}
I also tried replacing all catch block with only single block of Exception e , but still it’s not capturing the exception
I am able to catch AxisFault errors with the following :
AxisFaultis a subclass ofjava.rmi.RemoteException. You can know this by looking at the API docs. The class hierarchy is shown in the upper, left-hand corner of the page.As for why this was not caught when you used
java.lang.Exceptionin acatchstatement, perhaps you could post the relevant code?