Running an XML-RPC server as a Java servlet
The build.xml file.
The web.xml file.
The XmlRpcServlet.properties file, which defines which of your classes handle which remote method calls.
The handler class for this example.
And finally, the Log4J log4j.properties file, which I always deploy early in this sort of project – because I know I will eventually want it. See initLogger() in servlet.init(). The log4j.properties and initLogger() method immediately allow for the creation of rolling appenders for log output to a disk file.
You will also need the ws-commons jar file. This is an unsettling URL, what with the string literal SNAPSHOT in it. If anyone has a better version that bespeaks stability, I would appreciate knowing. It was the only jar of its type I could find to satisfy the VM (argh).
Here is what the war file looks like after ant dist
images/ META-INF/ META-INF/MANIFEST.MF WEB-INF/ WEB-INF/classes/ WEB-INF/classes/org/ WEB-INF/classes/org/apache/ WEB-INF/classes/org/apache/xmlrpc/ WEB-INF/classes/org/apache/xmlrpc/webserver/ WEB-INF/classes/org/apache/xmlrpc/webserver/XmlRpcServlet.properties WEB-INF/classes/org/carpediem/ WEB-INF/classes/org/carpediem/phonegnome/ WEB-INF/classes/org/carpediem/phonegnome/crm/ WEB-INF/classes/org/carpediem/phonegnome/crm/Handler.class WEB-INF/classes/org/carpediem/phonegnome/crm/log4j.properties WEB-INF/classes/org/carpediem/phonegnome/crm/PGXMLRPCServer.class WEB-INF/lib/ WEB-INF/lib/log4j-1.2.13.jar WEB-INF/lib/ws-commons-util-1.0-SNAPSHOT.jar WEB-INF/lib/xmlrpc-3.0a1.jar WEB-INF/web.xml
The war file is copied, of course, into /webapps of your servlet container (e.g., Tomcat, jetty), and the container started.
The resulting example servlet can service a remote call of the form crm.inBound(string1,string2).