RemoteException which works in quite well with the existing client stuff. It even provides a factory method for making a SOAP Fault from an exception; unfortunately this doesn't seem to contain the stack trace of the given exception, and it appears to wrap an extra AxisFault into the details bit.
However you can manually build it like this:
protected AxisFault makeFault(boolean blameClient, String message, Throwable cause) {
AxisFault fault = new AxisFault(message);
//set fault code according to standard (?) - should the client check what was sent
//or is the problem on the server.
if (blameClient) {
fault.setFaultCode("Client");
} else {
fault.setFaultCode("Server");
}
fault.clearFaultDetails();
if (cause != null) {
StringWriter writer = new StringWriter();
cause.printStackTrace(new PrintWriter(writer));
fault.addFaultDetailString(writer.toString());
}
return fault;
}
This might be extended to extract the cause from common exceptions such as InvocationTargetException, not rewrapping if the cause is an AxisFault, etc, but I like as much information as I can get.
![]() |
Click here for the AstroGrid Service Web |
This is the AstroGrid Development Wiki |
|