if (method == null) {
throw new EvaluatorException("Invalid method name");
}
RhinoCore core = RhinoCore.getCore();
Scriptable retval = null;
try {
retval = Context.getCurrentContext().newObject(core.getScope());
XmlRpcClient client = new XmlRpcClient(url);
int l = args.length;
Vector v = new Vector();
for (int i = 0; i < l; i++) {
Object arg = core.processXmlRpcResponse(args[i]);
v.addElement(arg);
}
Object result = client.execute(method, v);
// FIXME: Apache XML-RPC 2.0 seems to return Exceptions instead of
// throwing them.
if (result instanceof Exception) {
throw (Exception) result;
}
retval.put("result", retval, core.processXmlRpcArgument(result));
} catch (Exception x) {
String msg = x.getMessage();
if ((msg == null) || (msg.length() == 0)) {