Author |
Message
|
mverh |
Posted: Fri Jan 30, 2004 7:47 am Post subject: Validating XML on Output |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
We are running WMQI V2.1 CSD04. We have a flow which xfroms a cobol data stream to xml. We have a pic x of field that sometimes contains invalid characters i.e. x'00'. I am trying to figure out a way to capture this and throw an exception since I don't want the xml sent because it is possible validating xml parsers will error out.
On the validation tab of the last compute node the message flows through I set the Validation option to "Content and Value" and the Failure Action to "Exception" but this doesn't cause the flow to throw an exception when there is an embedded null.
Does anyone have a way to prevent the broke from producing invalid xml and throwing an exception when it does encounter invalid xml? Note the interesting thing is if I send in an xml message to the broker and embed an invalid character the broker throws an exception.
Thanks. _________________ Marc Verhiel
IBM Canada Ltd. |
|
Back to top |
|
 |
mverh |
Posted: Fri Jan 30, 2004 8:25 am Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
It just dawned on me that the validation feature will only apply to the messages in the MRM domain and since I'm in the XML domain I can't utilize this feature. Still would like to hear from anyone who has figured a way to validate output xml when in the xml domain... _________________ Marc Verhiel
IBM Canada Ltd. |
|
Back to top |
|
 |
Michael Dag |
Posted: Fri Jan 30, 2004 8:57 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
Marc,
wasn't this possible with the import of a DTD into the MRM.
This way you can validate XML using the MRM.
Never tried it myself though
Michael |
|
Back to top |
|
 |
Michael Dag |
Posted: Sat Jan 31, 2004 4:02 pm Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
Ok gave it a shot, picked up a DTD imported into MRM created a message in the MRM with the top level element of the DTD, it now becomes visible in the output message panel of the compute node, selected and map some fields.
If I turn on validating it keeps throwing exceptions (as I didn't provide enough fields on the incoming NEON format) when I turn validation to none, it just sends the XML with the elements that are there to the output node and creates the message.
Michael |
|
Back to top |
|
 |
mverh |
Posted: Sat Jan 31, 2004 10:15 pm Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
Michael, thanks for the update...unfortunately we don't have DTD's but rather XSD's so it looks like V5 will be what we will need to move to in order to get this validation. I have a V5 dev box so I think I'll try it out there and see if I can get it to work. _________________ Marc Verhiel
IBM Canada Ltd. |
|
Back to top |
|
 |
kirani |
Posted: Sat Jan 31, 2004 11:14 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Even with WMQI 2.1 you can import XML Schema into a message set. I think you need to be at CSD3 level to do this. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
mverh |
Posted: Sun Feb 01, 2004 11:01 am Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
Great! I try it on the V2.1 box then since we are at CSD04... _________________ Marc Verhiel
IBM Canada Ltd. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 03, 2004 2:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
MRM message validation works from the logical model - it does not have any XML-specific rules, so it will not automatically catch an invalid XML character. MRM validation is for validating against
a) the content of a structure (all required field present etc)
b) the value of a field ( >100, <150, minLength=2 etc)
If you need to check the contents of a field before you assign it to an output field, you'll probably need some ESQL. |
|
Back to top |
|
 |
|