You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Daniel <da...@yorku.ca> on 2005/12/09 23:43:01 UTC

Question on fault handling in xml-rpc 2.0

Hi,

It seems there's a change to the handling of xml-rpc faults in version 2.0
of Apache's xml-rpc implementation.  Pre-2.0 if there was a fault on a
call, the library would throw it to the calling client.  Now in 2.0 the
fault is decoded and returned.

Does anyone know why the fault is returned rather than being thrown?

I've dug into the code in XmlRpcClient.java -> XmlRpcClientWorker.java ->
XmlRpcClientResponseProcessor.java, to find out that it is in fact doing
what I decribed above. Lines 59-80 of XmlRpcClientResponseProcessor.java
is below:

59    public Object decodeResponse(InputStream is)
        throws XmlRpcClientException
    {
        result = null;
        fault = false;
        try
        {
            parse(is);
            if (fault)
            {
                return decodeException(result);
//              ^^^^^^^^^^^^^^^^^^ specifically this line above?!
            }
            else
            {
                return result;
            }
        }
        catch (Exception x)
        {
            throw new XmlRpcClientException("Error decoding XML-RPC
response", x);
        }
80    }


Regards,
Daniel