|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Hex output and Mapping node |
« View previous topic :: View next topic » |
Author |
Message
|
AnaS |
Posted: Tue Apr 06, 2010 12:56 pm Post subject: Hex output and Mapping node |
|
|
Newbie
Joined: 06 Apr 2010 Posts: 4
|
I have a field in my output message which is always assigned a fixed value of
(hex 70B3) . Message format is TDS message. I am using a mapping node to do my message mappings for all other elements which are in ASCII. For this one element, I need to always set hex value for "70B3". I know I can do this using esql and compute node. Is it possible by just using mapping node ? |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 06, 2010 4:10 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Your question is a little confusing. The Mapping node allows you to do transformations on your message tree(s). A parser (such as TDS) allows you to write out a message tree in the required format. TDS can write binary integers and BLOBs, if you construct your message set correctly.
btw, what does the 0x70B3 represent? |
|
Back to top |
|
 |
AnaS |
Posted: Wed Apr 07, 2010 3:10 am Post subject: Clarification |
|
|
Newbie
Joined: 06 Apr 2010 Posts: 4
|
Pardon my ignorance, it is my first broker project. Let me clarify.
I need to convert an XML message to a TDS message format.
There is one field in my output message which has non-ascii characters.The value for this field is always a constant '70B3' and is not present in my incoming XML message. I am using a mapping node to do the transformation. In my message set for my TDS message,I have an element defined(String DataType) for this constant field and I am assigning a dummy constant value in my mapping node. Later in a compute node , I do the following:
SET OutputRoot.BLOB.BLOB = x'70B3' || REPLACE(InputRoot.BLOB.BLOB, x'5E', x'');
The above works. I wanted to know if I can eliminate the compute node and set this value directly in my mapping X'70B3'. Basically, this prints out some special characters 'p³' which is what my client needs as a message identifier. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 07, 2010 3:46 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
In my message set for my TDS message,I have an element defined(String DataType) for this constant field |
Why have you set the data type to xs:string? Why not xs:int or xs:hexBinary?
Quote: |
Later in a compute node , I do the following:
SET OutputRoot.BLOB.BLOB = x'70B3' || REPLACE(InputRoot.BLOB.BLOB, x'5E', x'');
The above works. I wanted to know if I can eliminate the compute node and set this value directly in my mapping X'70B3'. |
You are working against message broker, rather than working with it. When you design a message flow, the physical representation of the data should (almost) never be reflected in the message flow. That's what the parser is for - it translates from a bit stream into a message tree, and from a message tree to a bit stream.
What you need to do is:
- In your message set, change the logical type of your field to xs:hexBinary or xs:int
- In the Mapping node, set the fixed value of the field. If you choose xs:int, remember to set an integer value, not a string value. Same for xs:hexBinary - you'll need a BLOB in that case.
- In your message set, set the TDS physical format properties so that you get the correct bytes in the output message. If you choose xs:int, that will mean setting 'Physical Type' to 'Integer'. If you choose xs:hexBinary, you will need to set a BLOB value in the mapping node, and the value should be written correctly. |
|
Back to top |
|
 |
AnaS |
Posted: Fri Apr 09, 2010 11:01 am Post subject: |
|
|
Newbie
Joined: 06 Apr 2010 Posts: 4
|
Quote: |
In your message set, set the TDS physical format properties so that you get the correct bytes in the output message. If you choose xs:int, that will mean setting 'Physical Type' to 'Integer'. If you choose xs:hexBinary, you will need to set a BLOB value in the mapping node, and the value should be written correctly. |
Can you please guide me on how to set a BLOB value in the mapping node? |
|
Back to top |
|
 |
AnaS |
Posted: Fri Apr 09, 2010 11:28 am Post subject: Solved |
|
|
Newbie
Joined: 06 Apr 2010 Posts: 4
|
Thanks for your guidance !!!
All I did was set my fixed value to "70" , defined my data type as hexbinary , set the physical representation length to 1 byte.
Similarly for "B3". |
|
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
|
|
|
|