Hi All,
I have a question concerning the parsing of the parameters in a function
in xmlrpc 3.0b1.
Imagine 2 methods which are exposed to the xml-rpc server.
public String getA(int id) {
return result;
}
public String getB(int id, String lang) {
return result;
}
Looking from the client side we see the following.
To invoke the method I use:
public String getA(int id) {
Object[] params = new Object[]{id};
String res = (String) xmlrpc.execute ("Box.getA", params);
return res;
}
public String getB(int id, String lang) {
Object[] params = new Object[]{id, lang};
String res = (String) xmlrpc.execute ("Box.getB", params);
return res;
}
When I execute "getA(int id)" the result is returned perfectly
However, when I execute "getB(int id, String lang)", the following
exception is thrown:
------------------------------------------------------------------------
-
19-jul-2006 18:20:32 org.apache.xmlrpc.server.XmlRpcStreamServer execute
SEVERE: execute: Error while performing request
org.apache.xmlrpc.XmlRpcException: No method matching arguments:
java.lang.Integer, java.lang.String
at
org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRp
cHandler.java:129)
at
org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.j
ava:43)
at
org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:79)
at
org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.j
ava:182)
at
org.apache.xmlrpc.webserver.Connection.run(Connection.java:175)
at
org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPool.java:71)
at
org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.java:87)
------------------------------------------------------------------------
-
"No method matching arguments: java.lang.Integer, java.lang.String"
There is further no difference between getA and getB. If I for example
just add the String parameter to getA, the same exception is thrown.
So how can I solve this problem?
One solution can be to make the parameter a String, but this is more of
a workaround.
Is there another solution or am I doing something wrong?
Greetz
Pieter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]