import java.util.Vector; import org.apache.xmlrpc.XmlRpcClient; public class XMLRPCTest { /** * @param args */ public static void main(String[] args) { try { Object result; /* You can specify an alternative target URL here */ XmlRpcClient xmlrpc = new XmlRpcClient ("http://blog.lobstertechnology.com/xmlrpc"); /* * demo.sayHello operation, returns a java.lang.String * */ result = xmlrpc.execute( "demo.sayHello", new Vector() ); System.out.println( "demo.sayHello: " + result + " (" + result.getClass().getName() + ")" ); /* * demo.addTwoNumbers operation, returns a java.lang.Integer * */ Vector params = new Vector (); params.addElement ("5"); params.addElement ("8"); result = xmlrpc.execute( "demo.addTwoNumbers", params ); System.out.println( "demo.addTwoNumbers: " + result + " (" + result.getClass().getName() + ")" ); } catch ( Exception e ) { e.printStackTrace(); } } }