I solved this problem for me by using my own exception derived from
XmlRpcException.
public class XmlRpcServerException extends XmlRpcException
{
public XmlRpcServerException(int code, String message)
{
super(code, message);
}
public String toString()
{
if (getCause() != null)
return getMessage() + " => " + getCause().toString();
else
return super.toString();
}
}
As you can see in XmlRpcResponseProcessor in the method processException()
// Retrieve XmlRpcException error code(if possible).
int code = x instanceof XmlRpcException ?
((XmlRpcException) x).code : 0;
you can set your own fault codes by throwing Exceptions derived from
XmlRpcException.
-----Ursprungliche Nachricht-----
Von: Tanya Brethour [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 30. Oktober 2003 17:20
An: [EMAIL PROTECTED]
Betreff: RE: Server side exceptions
> >> And why not re-generating exception by parsing the message exception ?
>
> >Because it almost seems like a hack. I just thought there was probably a
> >more proper way to do it. But maybe there isn't :)
>
> Yes... Exceptions are a java mechanism and xmlrpc must be interoperant
(with
> fault
> codes).
So, how exactly do I specify the fault codes? I use the server to generate
the methodReponse bodies... and there doesn't seem to be a way to control
the fault code part.
Thanks,
Tanya