ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel <dant...@yorku.ca>
Subject Question on fault handling in xml-rpc 2.0
Date Fri, 09 Dec 2005 22:43:01 GMT

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

Mime
View raw message