A Java Client
import org.apache.xmlrpc.*;
public class JavaClient {
public static void main (String [] args) {
XmlRpcClient server = new XmlRpcClient("http://localhost/RPC2");
Vector params = new Vector();
params.addElement(new Integer(17));
params.addElement(new Integer(13));
Object result = server.execute("sample.sum", params);
int sum = ((Integer) result).intValue();
System.out.println("The sum is: "+sum);
} catch (Exception exception) {
System.err.println("JavaClient: " + exception);
When problems occur (no connection, etc.) an Exception is thrown and has to be caught.