ws-xmlrpc claims error on part of service but other clients work fine

Posted by mludd on Stack Overflow See other posts from Stack Overflow or by mludd
Published on 2011-11-13T17:45:44Z Indexed on 2011/11/13 17:51 UTC
Read the original article Hit count: 526

Filed under:
|

I've been trying to connect to an rTorrent instance using ws-xmlrpc and it just isn't going too well.

Now, the URL I'm using is the same that I've been using when making sure that rTorrent's XMLRPC support is fine (which it appears to be since both a native OS X application and a small python script I threw together appear to be able to talk to it just fine without any errors). However, when I try using ws-xmlrpc to connect I get org.apache.xmlrpc.XmlRpcException: Failed to create input stream: Unexpected end of file from serverat the top of my stack trace followed by a bunch of steps down to:

java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
    ...

So basically, it seems that ws-xmlrpc is convinced that the reply from rTorrent is malformed somehow but other libraries apparently have no problem with it.

The code I use to call rTorrent is:

private Object callRTorrent(String command, Object[] params) {
    Object result = null;

    try {
        // xmlrpcclient is an XmlRpcClient object and is instantied in
        // the class constructor
        result = xmlrpcclient.execute(command, params);
    }
    catch(XmlRpcException xre) {
        System.out.println("Unable to execute method "+command);
        xre.printStackTrace();
    }

    return result;
}

With command set to system.listMethodsand params set to an empty Object[].

From reading documentation and googling my conclusion is that I'm not doing anything obviously wrong and this problem doesn't appear to be common, so does anyone have a clue what's going on here?

© Stack Overflow or respective owner

Related posts about java

Related posts about xml-rpc