ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Mattler <>
Subject AW: Server side exceptions
Date Thu, 30 Oct 2003 18:06:16 GMT
I solved this problem for me by using my own exception derived from

public class XmlRpcServerException extends XmlRpcException
	public XmlRpcServerException(int code, String message)
		super(code, message);

	public String toString()
		if (getCause() != null)
			return getMessage() + " => " + getCause().toString();
			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

-----Ursprungliche Nachricht-----
Von: Tanya Brethour []
Gesendet: Donnerstag, 30. Oktober 2003 17:20
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
> 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.


View raw message