GAE - How to make an XML-RPC call?

advertisements

I need to make a standard XML-RPC call to the UPC Database (www.upcdatabase.com) using my Google AppEngine Java application.

I found a lot of information on incorporating XML-RPC within GAE but couldn't find anything on how to make a call from GAE.

Any help or examples would be appreciated ?


Well what do you know....

I did the following using the Redstone XMLRPC library and it works. Won't have figured that with all the focus on using URLFetch.

XmlRpcClient client = new XmlRpcClient("http://www.upcdatabase.com/xmlrpc", false);
    Map<String, String> params = new HashMap<String, String>();
    params.put("rpc_key", rpc_key);
    params.put("ean",upc);

    HashMap<?,?> token = null;
    try {
        token = (HashMap<?, ?>) client.invoke( "lookup", new Object[] { params } );
    } catch (XmlRpcException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (XmlRpcFault e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

Don't quite know why it works and would love an explanation.