ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Call java method from ESQL

Post new topic  Reply to topic
 Call java method from ESQL « View previous topic :: View next topic » 
Author Message
PieterV
PostPosted: Tue Jun 12, 2007 11:02 pm    Post subject: Call java method from ESQL Reply with quote

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.

What am i doing wrong?
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Tue Jun 12, 2007 11:09 pm    Post subject: Re: Call java method from ESQL Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Hi,
Broker has Base64 class.

Why you don't want to use it ?
Code:


CREATE PROCEDURE b64Encode(IN source BLOB)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "com.ibm.broker.javacompute.Base64.encode";



PS.

Check parameters in your code .


CHARACTER, OUT S2 CHARACTER <> String element
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Call java method from ESQL
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.