|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
parsing hex to number using ASCII table |
« View previous topic :: View next topic » |
Author |
Message
|
Vitor |
Posted: Wed Jun 17, 2009 9:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
So it's an integer. |
I said that  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
JULLRICH |
Posted: Wed Jun 17, 2009 10:21 am Post subject: |
|
|
Apprentice
Joined: 11 Aug 2005 Posts: 42 Location: München
|
Hi,
...that means I have to parse the first 2 bytes as integer to get the length-element and the other bytes as string using the length-element as LengthReference.
Isn't it?
I was doing this before also:
It is not working!
Result:
Message data : ''0001JB001234''
Text element offset : 2
Expected length of element : 3072
=> Exception
InputMsg:
X'000C303030314A42303031323334'
There must be another way of interpreting this 000C according to the ASCII Table ...
SRY, but it is my second MsgSet, I build!
another way:
When setting up an CWF with a single Element of physType LengthEncodedString 2 then WMB expects data length of 3072 in case of 000C and 2048 in case of 0008
=> it is also not working |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 17, 2009 10:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You did not configure your integer physical properties to match the correct byte order. You're receiving the integer in network byte order, since it's coming over TCP/IP. |
|
Back to top |
|
 |
JULLRICH |
Posted: Thu Jun 18, 2009 1:40 am Post subject: |
|
|
Apprentice
Joined: 11 Aug 2005 Posts: 42 Location: München
|
You must be right, because when working with one byte describing the length, it is working well.
So I have to change the byte order in that integers are being interpreted.
=> BigEndian LittleEndian ....
... and it worked fine also with 2 bytes of encoded length!
THX to you! |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|