Start up the XML-RPC server and register a handler.
if (args.length < 1) {
System.out.println(
"Usage: java HelloServer [port]");
System.exit(-1);
}
try {
// Use the Apache Xerces SAX Driver
XmlRpc.setDriver("org.apache.xerces.parsers.SAXParser");
// Start the server
System.out.println("Starting XML-RPC Server...");
WebServer server = new WebServer(Integer.parseInt(args[0]));
// Register our handler class
server.addHandler("hello", new HelloHandler());
System.out.println(
"Registered HelloHandler class to \"hello\"");
System.out.println("Now accepting requests...");
} catch (ClassNotFoundException e) {
System.out.println("Could not locate SAX Driver");
} catch (IOException e) {
System.out.println("Could not start server: " +
e.getMessage());
}