public ESValue doIndirectCall(Evaluator evaluator, ESObject target,
String functionName, ESValue arguments[])
throws EcmaScriptException, NoSuchMethodException
{
// System.out.println ("doIndirectCall called with "+functionName);
XmlRpcClient client = new XmlRpcClient(url);
long now = System.currentTimeMillis();
Object retval = null;
int l = arguments.length;
Vector v = new Vector();
for (int i = 0; i < l; i++)
{
Object arg = FesiRpcUtil.convertE2J(arguments[i]);
// System.out.println ("converted to J: "+arg.getClass ());
v.addElement(arg);
}
// System.out.println ("spent "+(System.currentTimeMillis ()-now)+" millis in argument conversion");
ESObject esretval = ObjectObject.createObject(evaluator);
try
{
String method = remoteObject == null ? functionName
: remoteObject + "." + functionName;
retval = client.execute(method, v);
esretval.putProperty("error", ESNull.theNull,
"error".hashCode());
esretval.putProperty("result", FesiRpcUtil.convertJ2E(retval,
this.evaluator), "result".hashCode());
}