import java.io.IOException; import java.net.MalformedURLException; import java.util.Vector; import org.apache.xmlrpc.*; public class HelloClient { public static void main(String args[]) { if (args.length < 1) System.exit(-1); try { XmlRpc.setDriver("org.apache.xerces.parsers.SAXParser"); // Specify the server XmlRpcClient client = new XmlRpcClient("http://localhost:8585/"); // Create request Vector params = new Vector(); params.addElement(args[0]); // Make a request and print the result String result = (String)client.execute("hello.sayHello", params); System.out.println("Response from server: " + result); } catch (ClassNotFoundException e) { System.out.println("Could not locate SAX Driver"); } catch (MalformedURLException e) { System.out.println("Incorrect URL for XML-RPC server format: " + e.getMessage()); } catch (XmlRpcException e) { System.out.println("XML-RPC Exception: " + e.getMessage()); } catch (IOException e) { System.out.println("IO Exception: " + e.getMessage()); } } }