Posted: Tue May 10, 2005 11:12 am Post subject: New to References
Centurion
Joined: 09 Oct 2002 Posts: 100 Location: Kansas City
I was trying out using REFERENCE in my message flows to increase performance I had no problems using the REFERENCE for input. For example a simple message copy.
--message headers
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
--
DECLARE InputMsg REFERENCE TO InputRoot.XML.XMLMessage;
SET OutputRoot.XML.XMLSvc = InputMsg;
where I started to have problems was using REFERENCE with output like so...
--message headers
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
--
DECLARE OutputMsg REFERENCE TO OutputRoot.XML.XMLMessage;
SET OutputMsg = InputRoot.XML.XMLMessage;
when I use the above code nothing is transfered to the XML tree. Can anyone please Help. I am using WBIMB V5 CSD(most recent) with MQ 5.3 running on AIX.
Joined: 09 Oct 2002 Posts: 100 Location: Kansas City
I guess it would help for the REFERENCE to have something that exists to point to. Once I put in the CREATE FIELD everything started working. Thanks.
-- Final Code
Code:
--message headers
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
--
CREATE FIELD OutputRoot.XML.XMLMessage;
DECLARE OutputMsg REFERENCE TO OutputRoot.XML.XMLMessage;
SET OutputMsg = InputRoot.XML.XMLMessage;
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