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;
}