Author |
Message
|
abcmno123 |
Posted: Thu Aug 17, 2006 10:22 pm Post subject: Problem in XML message parsing |
|
|
Novice
Joined: 16 Aug 2006 Posts: 22
|
Hi,
I am giving a TDS message as input whose delimiter is a new line character.Hence, if I give a XML message as input then the message must be rejected because of TDS general error.This much is working fine if I give a normal XML message.
But if I input a XML message which contains MQRFH2 header then this xml message is parsed without throwing any exception.
Why is it so??? |
|
Back to top |
|
 |
kimbert |
Posted: Fri Aug 18, 2006 12:28 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
More details required:
- Message broker version and CSD level
- What does the MQRFH2 header contain? Please list the Domain/MessageSet/MessageType/MessageFormat. |
|
Back to top |
|
 |
abcmno123 |
Posted: Fri Aug 18, 2006 12:48 am Post subject: |
|
|
Novice
Joined: 16 Aug 2006 Posts: 22
|
Message broker version - 5.0, fix pack - 5
MQRFH2 header contains vesion, frmat, ecoding,codedcharsetid, flag, amevalueCCSID.
domain - MRM
essage format - TDS |
|
Back to top |
|
 |
kimbert |
Posted: Fri Aug 18, 2006 1:06 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
But if I input a XML message which contains MQRFH2 header then this xml message is parsed without throwing any exception. |
1. Message Broker selects a parser based on the 'Domain' in the message properties folder. If the MQRFH2 header tells it to use an XML parser, then it will do so.
2. Why do you expect a parsing error when you put an XML message into your flow? If your message set is simply dividing the input into lines, it should parse an XML document without a problem.
I don't really understand what you're trying to accomplish - please explain your requirements in full. |
|
Back to top |
|
 |
abcmno123 |
Posted: Fri Aug 18, 2006 1:26 am Post subject: |
|
|
Novice
Joined: 16 Aug 2006 Posts: 22
|
I want to send an input message in TDS format in which the delimiter is a comma. Another thing is that one single message contains many messages which are separated by new line character.
some thing like,
A1,B1,C1
A2,B2,C2
the above is how the message looks like.
and I dont want an incoming message to be in xml format i.e, I dont want the xml message to be parsed. the moment the xml message comes as input it must throw an exception and go to failure node. |
|
Back to top |
|
 |
vinbud117 |
Posted: Fri Aug 18, 2006 1:37 am Post subject: |
|
|
Acolyte
Joined: 22 Jul 2005 Posts: 61
|
turn on the validation.... choose content n value... |
|
Back to top |
|
 |
abcmno123 |
Posted: Fri Aug 18, 2006 1:39 am Post subject: |
|
|
Novice
Joined: 16 Aug 2006 Posts: 22
|
|
Back to top |
|
 |
kimbert |
Posted: Fri Aug 18, 2006 1:52 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
If I was doing this I would parse the message in the BLOB domain, check the first few bytes for an XML tag, and then re-parse in the MRM domain. |
|
Back to top |
|
 |
abcmno123 |
Posted: Fri Aug 18, 2006 2:11 am Post subject: |
|
|
Novice
Joined: 16 Aug 2006 Posts: 22
|
If the message is parsed once, how do we re-parse it again... put a MQInput node again to parse it? |
|
Back to top |
|
 |
sebastianhirt |
Posted: Fri Aug 18, 2006 2:23 am Post subject: |
|
|
Yatiri
Joined: 07 Jun 2004 Posts: 620 Location: Germany
|
You can use a ResetContentDescriptor Node to reparse the message |
|
Back to top |
|
 |
wschutz |
Posted: Fri Aug 18, 2006 2:23 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Use the "Reset Content Descriptor" node _________________ -wayne |
|
Back to top |
|
 |
abcmno123 |
Posted: Fri Aug 18, 2006 3:47 am Post subject: |
|
|
Novice
Joined: 16 Aug 2006 Posts: 22
|
But my actual problem is that if I give a normal xml message as input then it does not parse it but if I give a xml message which has MQRFH2 header then it does not parse. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 18, 2006 4:02 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Broker uses the MQRFH2 to determine how to parse a message, based on the contents of certain properties in the MQRFH2.
I'm guessing that the appearance of an MQRFH2, that includes the absences of those properties, means that Broker will still ignore the settings on the MQInput node (which are now and have always been defaults), and make it's own best guesses about how to parse the data. And since XML is self-defining, broker will automatically parse the data just fine.
Rather than screwing around with setting the MQInput node to BLOB (which disables the MQRFH2 checking) and then playing with bitstreams and substrings and etc...
Do a sanity check as your first action in your flow to find out if the first child of InputBody is what you expect it to be or not... If it's not, throw an error. Or check that InputRoot.Properties.Domain, InputRoot.Properties.MessageSet, etc. match what you're expecting. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|