Posted: Tue Jun 12, 2007 11:02 pm Post subject: Call java method from ESQL
Disciple
Joined: 04 Jan 2006 Posts: 164 Location: Belgium
I'm trying to call a java method that will convert a String to a Base64 encoded String and return that to the ESQL function.
at thet moment i have the following, but it's not working:
java:
Code:
package nmbs;
public final class a926_teamware_MF_twSendMail_BuildBase64 {
public static String[] getBase64(String element) {
try
{
element = com.ibm.broker.javacompute.Base64.encode(element.getBytes());
}
catch(Exception e)
{
}
String[] out = new String[1];
out[0] = element;
return out;
}
}
and in ESQL:
Code:
CREATE COMPUTE MODULE a926_teamware_MF_twSendMail_Build_Soap_twSendMailAtt
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL encodeBase64(Environment.Variables.Attachment[Count].AttString, Environment.Variables.test) INTO Environment.Variables.test;
RETURN TRUE;
END;
CREATE PROCEDURE encodeBase64( IN S1 CHARACTER, OUT S2 CHARACTER)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "nmbs.a926_teamware_MF_twSendMail_BuildBase64.getBase64";
END MODULE;
I get an error that the java method could not be found. Before this error i got an error that said my return values were not correct, I've changed it using the String[] etc... So i think the error that the java method could not be found is not exact, cause it could find it before.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum