|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Length reference |
« View previous topic :: View next topic » |
Author |
Message
|
KIT_INC |
Posted: Fri Jul 22, 2011 10:46 am Post subject: Length reference |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
I am learning how to model a message. My environment is WMB V61
I have a message which is just 1 byte length followed by data.
I created a CWF Message with two local elements
MSG_Length - type integer , length 1 byte
MSG_Data - type string length reference MSG_Length, Length unit character
When I parsed an Input message (2ab) using MQInput node. I hope the mrm parser will read the first byte '2' as length and expect 2 characts of data to follow (which is ab). However I got a parser error saying that the expected length is 50. I think the parser is reading the 2 as hex 32 (dec 50) and hence expect 50 characters to follow.
If this is the way the parser works, how can I do this for messages with only 2 of 3 bytes of data ? |
|
Back to top |
|
 |
joebuckeye |
Posted: Fri Jul 22, 2011 11:27 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
The character '2' is not the same thing as an integer representing the number 2. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 22, 2011 12:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
joebuckeye wrote: |
The character '2' is not the same thing as an integer representing the number 2. |
KIT_INC wrote: |
If this is the way the parser works, how can I do this for messages with only 2 of 3 bytes of data ? |
By putting an integer representation of the value 2 (or 3) as appropriate in the first byte.
Can be a bit fiddly with RFHUtil et al, but a few line of code in the language of your choice will do it fine.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Jul 23, 2011 12:50 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Your message model is wrong.
You have told the parser to expect a binary integer in the first field, but your input data actually contains a text integer. You could model it as an 'external decimal' in CWF. Alternatively, use TDS to model your data - TDS assumes that your data is represented as text. |
|
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
|
|
|
|