|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Check InputBody Exists |
« View previous topic :: View next topic » |
Author |
Message
|
cvag |
Posted: Tue Nov 17, 2009 10:51 pm Post subject: Check InputBody Exists |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi,
Need suggestion on how to check the inputbody exists or not, irrespective of domain..it may be any input format.
Code:
IF (InputBody IS NOT NULL) THEN
SET OutputRoot.XML.ErrorMessage.ActualMessage = CAST(OriginalMessage AS CHAR CCSID 1208);
ELSE
THROW USER EXCEPTION MESSAGE 2951 VALUES('Zero Length Data Found', OriginalMessage);
END IF;
I tested the flow with specifying the domain aswell as with not specifying the domain.
During debug(with Domain and message)
The code is working fine and the InputBody is refering to the domain which i give.
Without Domain and with empty message
InputBody is refering to the header 'MQMD'
Suggest pls.
Thanks 2 All. |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Nov 18, 2009 12:49 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
alternatively...
you can create a reference to input body
by e.g. referring the next child of MQMD / MQRFH2 / whichever header is applicable
and then check for the reference.. if its NULL then no data _________________ Cheers |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Nov 18, 2009 3:18 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
AkankshA wrote: |
alternatively...
you can create a reference to input body
by e.g. referring the next child of MQMD / MQRFH2 / whichever header is applicable
and then check for the reference.. if its NULL then no data |
It will not be null as the reference will move to InputRoot incase the body is missing...I think you meant LASTMOVE.
There is also something easier where you check the field to be of TYPE...
Regards. |
|
Back to top |
|
 |
mgk |
Posted: Wed Nov 18, 2009 3:40 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
When trying to write code like this, it is worth knowing that InputBody is actually defined to point to the "last child" of InputRoot. Therefore, if there is no actual "body" it will end up pointing to the last header (e.g. rfh2 or mqmd) or even properties if there are no headers either...
Kind Regards,
MGK _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|