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 » IBM MQ Java / JMS » MbElement, IN, INOUT, MbElement[]

Post new topic  Reply to topic
 MbElement, IN, INOUT, MbElement[] « View previous topic :: View next topic » 
Author Message
DanielSonFocus
PostPosted: Thu Aug 18, 2005 3:02 pm    Post subject: MbElement, IN, INOUT, MbElement[] Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

Hi,

I can't find any samples or documention out there on how to take a reference to InputRoot make some changes to it in a Java Procedure and send back the modified OutputRoot. I can call the Java procedure with ESQL and that works fine. But when the message gets to the Output Node i get a "No valid message body" could be found. Im thinking the java call is taking InputRoot and not setting the OutputRoot.

Here's my call in ESQL:

Code:

CREATE COMPUTE MODULE JavaSendMail_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      CALL CopyEntireMessage();
      
      DECLARE resp CHAR Swap(InputRoot.XML, 'true', 'c:\smtpmail\logs\smtplog.log');
 
        SET OutputRoot.XML.resp = resp;
                      
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
      WHILE I < J DO
         SET OutputRoot.*[I] = InputRoot.*[I];
         SET I = I + 1;
      END WHILE;
   END;

   CREATE PROCEDURE CopyEntireMessage() BEGIN
      SET OutputRoot = InputRoot;
   END;
END MODULE;


-------------------------------------------------------------------------------
--   Swap
-------------------------------------------------------------------------------
    CREATE PROCEDURE Swap(IN smtpMessage REFERENCE, IN debug CHAR, IN debugFile CHAR)
   RETURNS CHARACTER
   LANGUAGE JAVA
   EXTERNAL NAME "Swapper.swap";


Here's my java code:
Code:

public class Swapper
{   
    /*************************************************************************/
    public static String send(MbElement message, String dbug, String debugFile)
    {
        //Logic for changing an element in inputRoot and returning Outputroot?
    }
Back to top
View user's profile Send private message
DanielSonFocus
PostPosted: Thu Aug 18, 2005 6:10 pm    Post subject: Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

I need something like this, but it doesn't work:

Code:

CREATE COMPUTE MODULE JavaSendMail_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
      CALL CopyMessageHeaders();
      CALL CopyEntireMessage();
       
      DECLARE resp CHAR Swap(InputRoot.XML, OutputRoot.XML);
 
        SET OutputRoot.XML.resp = resp;
                       
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
      WHILE I < J DO
         SET OutputRoot.*[I] = InputRoot.*[I];
         SET I = I + 1;
      END WHILE;
   END;

   CREATE PROCEDURE CopyEntireMessage() BEGIN
      SET OutputRoot = InputRoot;
   END;
END MODULE;


-------------------------------------------------------------------------------
--   Swap
-------------------------------------------------------------------------------
    CREATE PROCEDURE Swap(IN inputRoot REFERENCE, INOUT outputRoot REFERENCE)
   RETURNS CHARACTER
   LANGUAGE JAVA
   EXTERNAL NAME "Swapper.swap";


Code:

public class Swapper
{   
    /*************************************************************************/
    public static String send(MbElement inputRoot, MbElement[] outputRoot)
    {
       outputRoot[0].copyElementTree(inputRoot);
    }
}
Back to top
View user's profile Send private message
DanielSonFocus
PostPosted: Mon Aug 22, 2005 9:22 am    Post subject: Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

anyone ?
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Aug 22, 2005 9:52 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Have one of the moderators move this to the WMQI forum. You might have better luck.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Mon Aug 22, 2005 10:39 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It might be that you aren't passing the right kinds of things to the procedure.

There were comments in the WMQI forum quite a while ago about passing in references to InputRoot and OutputRoot as well as LocalEnvironment and etc.

Also, you might be having some of the same kinds of issues that one has with a plugin where one needs to create a new assembly before one can update the trees.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MbElement, IN, INOUT, MbElement[]
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.