Hi again pskink,
I'm currently working in a server based on Java to make some test functionality por XML-RPC. Basically just as the server.py provided at your project in google code but I need to learn how to implement it in Java for a future application.
Basically I'm getting a nasty exception which, after looking into some webs and forums, I'm not able to fix.
The client part is the same provided in the project and the server is this one:
Using java Syntax Highlighting
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.webserver.WebServer;
public class JavaServer {
final static int port = 8080;
public int add(int i1, int i2) {
return i1 + i2;
}
public static void main(String[] args) {
try {
System.out.println("Attempting to start XML-RPC server...");
WebServer webServer = new WebServer(port);
XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
PropertyHandlerMapping phm = new PropertyHandlerMapping();
phm.addHandler("add", JavaServer.class);
xmlRpcServer.setHandlerMapping(phm);
webServer.start();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
Parsed in 0.033 seconds, using
GeSHi 1.0.8.4
The stack I'm getting printed after making with the client the first request, the one of the sum, is:
31-mar-2010 23:31:07 org.apache.xmlrpc.server.XmlRpcErrorLogger log
GRAVE: No such handler: add
org.apache.xmlrpc.server.XmlRpcNoSuchHandlerException: No such handler: add
at org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.getHandler(AbstractReflectiveHandlerMapping.java:214)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:45)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)
at org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)
31-mar-2010 23:31:54 org.apache.xmlrpc.server.XmlRpcErrorLogger logWhich handler I'm supposed to add to my server??
Of course, I will be very grateful if you comment to me any mistake or something you think I need to improve in my code.
Thank you very much for your help, best regards
Fernando.