The story so far…
I’ve succeeded in calling external third-party JARs in the CLASSPATH with the syntax
rval = Packages.au.com.csw.Eclaim.getInstance().getSessionId();
So far so good,
My current problem is working with Javascript data types in Servoy; most of the external Java methods return a vector type. I’m assuming this the equivalent of an Array in Javascript?? If it is, I haven’t found how to make it work.
If I’m calling the method from a Java app, I code it like this (works fine in JRE 1.4)
int rval = 0;
int sessionId = 123456; //eg
int errorCode = 2003; //eg
Vector result = new Vector();
rval = Eclaim.getInstance().getErrorText(sessionId, errorCode, result );
// then convert the vector result to a string
String sResult = "";
sResult = result.get(0);
return sResult;
In Servoy (Javascript)
var rval = 0;
var sessionId = 123456; //eg
var errorCode = 2003; //eg
var result = new Array();
rval = Packages.au.com.csw.Eclaim.getInstance().getErrorText(sessionId, errorCode, result );
Servoy spits at this point with
org.mozilla.javascript.EvaluatorException: Cannot convert [Ljava.lang.Object;@4ee76d to java.util.Vector (hicGetErrorText, line 6)
I’ve tried all sorts of variations of result with and without (), , (0) etc. with different error messages.
Any suggestions to make this work? My only thought is to create an intermediary external Java class that will convert the vector into strings and pass it to my Servoy script.