Author |
Message
|
wmqiadmin |
Posted: Fri Mar 09, 2007 4:26 pm Post subject: Strange problem |
|
|
 Disciple
Joined: 19 Jun 2005 Posts: 163 Location: epping UK
|
Hi All,
I have created an error handler message flow. In this I am handling messages on Q generated by System errors.
In my main flow I have a subflow which generates an error message (XML structure) with the error details, error codes error description and original message. In original message I am setting <OriginalMessage>InputRoot</OriginalMessage>
Now when I parse the error message in my error handler message flow and try to remove the original message from the original xml element the actual problem arises...
It works fine with XML structure messages but when I parse the TDS or CWF messages I get those messages in XML structure not in thier original Structure.
i.e.
my TDS message looks like this
[quote]<Value1>1234</Value1><Value2>984798</Value2><Value3>984732<Value3>
Instaed of
Quote: |
1234|984798|984732 |
Any suggestions on this how can I change this XML structure to original TDS structure.
Thanks
wmqiadmin |
|
Back to top |
|
 |
doubt_master |
Posted: Sun Mar 11, 2007 9:12 am Post subject: |
|
|
Novice
Joined: 02 Mar 2007 Posts: 10
|
For transforming the XML structure to TDS structure you need to create the MessageDefnition file for the TDS format.
Then you need to parse the values .
Then you have to map the elements |
|
Back to top |
|
 |
wmqiadmin |
Posted: Sun Mar 11, 2007 11:22 am Post subject: |
|
|
 Disciple
Joined: 19 Jun 2005 Posts: 163 Location: epping UK
|
Thanks dobt-master for your response, as i said I am parsing this TDS message format in the main flow and attaching the inputRoot in the Exceptional message handler flow to get the original message in case of some problem.
At this point the message in stored in the Broker as XML structure and it is saved as XML structure in the InputRoot. Is there any way i can store the message in TDS format in the broker after it has been parsed by the broker in the main flow??
Highly appriciate your inputs.
Thanks
wmqiadmin |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 12, 2007 2:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
If your message flow has already hit an error, I would not trust it to accurately recreate the original bitstream. If you need to return the original message, then save the bitstream in the environment ( as a BLOB ) before you parse it. |
|
Back to top |
|
 |
wmqiadmin |
Posted: Mon Mar 12, 2007 11:10 am Post subject: |
|
|
 Disciple
Joined: 19 Jun 2005 Posts: 163 Location: epping UK
|
kimbert wrote: |
If your message flow has already hit an error, I would not trust it to accurately recreate the original bitstream. If you need to return the original message, then save the bitstream in the environment ( as a BLOB ) before you parse it. |
Thanks Kimbert,
Can i revert the message once it is parsed by the broker? In this case can i revert the message in the subflow once it is parsed in the main flow?
Thanks
wmqiadmin |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 12, 2007 4:39 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Can i revert the message once it is parsed by the broker? |
You can parse and re-serialize your message as many times as you like. You can even do it within the same Compute ( or Java Compute) node using CREATE...PARSE and ASBITSTREAM.
However, in your case I would advise you to
- parse the message in the BLOB domain
- copy the original bitstream (InputRoot.BLOB.BLOB) to the environment tree
- Re-parse using your message set ( RCD node, or CREATE...PARSE )
- Use your copy of the original bitstream if you need to report it in an error message. |
|
Back to top |
|
 |
wmqiadmin |
Posted: Tue Mar 13, 2007 10:10 am Post subject: |
|
|
 Disciple
Joined: 19 Jun 2005 Posts: 163 Location: epping UK
|
Thanks a lot kimbert and every buddy else,
i'll look through this perspective.
wmqiadmin |
|
Back to top |
|
 |
wmqiadmin |
Posted: Fri Mar 30, 2007 10:15 am Post subject: |
|
|
 Disciple
Joined: 19 Jun 2005 Posts: 163 Location: epping UK
|
kimbert wrote: |
Quote: |
Can i revert the message once it is parsed by the broker? |
You can parse and re-serialize your message as many times as you like. You can even do it within the same Compute ( or Java Compute) node using CREATE...PARSE and ASBITSTREAM.
However, in your case I would advise you to
- parse the message in the BLOB domain
- copy the original bitstream (InputRoot.BLOB.BLOB) to the environment tree
- Re-parse using your message set ( RCD node, or CREATE...PARSE )
- Use your copy of the original bitstream if you need to report it in an error message. |
Hi,
I used RCD node converted XML message to BLOB, put the message in the XML Element, in the second flow I am extracting the message from the XML element and putting it on the output queue.
DECLARE origMsg BLOB;
SET origMsg = FIELDVALUE(InputRoot.XMLNS.Message.Error.OriginalMessage);
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR ';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
--SET OutputRoot.MQMD.CodedCharSetId = 1208;
--SET OutputRoot.MQMD.Encoding = 850;
--SET OutputRoot.MQMD.Format = MQFMT_STRING;
SET OutputRoot."BLOB"."UnknownParserName" = '';
OutputRoot.BLOB.BLOB = origMsg;
and in the output node i am getting this value
3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e0d0a3c464d4d6573736167653e0d0a203c464d4865616465723e0d0a20203c536f75726365436f6d706f6e656e743e437265646974204465636973696f6e2052657175657374204e6f6e2d43616e6f6e6963616c20584d4c205478666d20666c6f773c2f536f75726365
can you please help me here ?
thanks
wmqiadmin |
|
Back to top |
|
 |
|