Author |
Message
|
Qadeer_824 |
Posted: Tue Mar 25, 2008 10:51 pm Post subject: XML Input Validation using MRM domain |
|
|
 Acolyte
Joined: 04 Oct 2007 Posts: 59
|
Hi,
I have a message flow which gets an XML as input. This XML needs to be validated against an .xsd file. I have used this .xsd file to generate the message set and used MRM domain to configure the messageset and the MQInput node.
Following are the properties set:
MQInput Node:
Message Domain: MRM
Message Set: TEST_XML (IITOAQ0002001)
Message Type: Test
MessageFormat: CwXML
Validate: Content And Value
Failure Action: Exception
Parsing: On Demand
MessageSet:
Wire Format : CwXML
Runtime Parser : MRM
When i tested the flow with an invalid input, it passed through the mqinput node (maybe because parsing is set to OnDemand?). But in the next compute node, when it tired to access an attribute (inside a complex element which is mandatory), it didnt throw any error even though the complex element which is mandatory was missing in the input. Note that validation is set to Content and Value with failure action of Exception on the compute node.
I even tried changing the parse timing to Complete on mqinput node, but it happily went to the next node without an exception.
Can someone please help me out in resolving this?
Thnx in advance..
Regards,
Qadeer |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Mar 25, 2008 11:19 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
Parsing: Immediate instead of On Demand _________________ Cheers |
|
Back to top |
|
 |
Qadeer_824 |
Posted: Wed Mar 26, 2008 12:43 am Post subject: no success yet! |
|
|
 Acolyte
Joined: 04 Oct 2007 Posts: 59
|
Hi Akanksha,
Changed the parse timing to "Immediate" but still doesnt seem to work. It succesfully parses the input without any exception ..
The xsd defines the structure as given below:
Code: |
TestSAP.mxsd
->Messages
->Test
->{Local Complex Type} (Composition = choice, content validation = closed)
->cust_bills (MinOccurs = 1, MaxOccurs =1)
->{Local Complex Type} (Composition=sequence, content validation=closed)
-> orders (minoccurs=1, maxoccurs=1)
|
I tried the following input xmls'
Code: |
<?xml version="1.0" encoding="UTF-8"?><Test></Test>
|
Code: |
<?xml version="1.0" encoding="UTF-8"?><Test><cust_bills></cust_bills></Test>
|
but both get parsed fine. |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Mar 26, 2008 12:58 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
are u on latest fixes..
as few of my colllegues also faced this problem sometime back... n guess fixes resolved their problem...
let me chk wd them now _________________ Cheers |
|
Back to top |
|
 |
kimbert |
Posted: Wed Mar 26, 2008 1:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Which version/fix pack are you using?
Your schema looks a little strange. Why are you using a choice with only one member? Are you quite certain that your input document is invalid according to that schema? |
|
Back to top |
|
 |
Qadeer_824 |
Posted: Wed Mar 26, 2008 2:08 am Post subject: |
|
|
 Acolyte
Joined: 04 Oct 2007 Posts: 59
|
I'm using V6.0 of Broker with MQ V5.3.
Not sure about the fixpack level (is there any command/tool which gives these details?)
Kimbert,
This schema was generated by application team. Going further they want to extend it to have many more elements (rather messages).
Yes, atleast it looks very obvious as the mandatory element itself is missing in the input (which should certainly throw an error). |
|
Back to top |
|
 |
Qadeer_824 |
Posted: Wed Mar 26, 2008 2:55 am Post subject: RESOLVED !! |
|
|
 Acolyte
Joined: 04 Oct 2007 Posts: 59
|
Hello Everybody,
The issue is now resolved. After replying to the message below, i had a look at the message set. It had the XML rendering options set and as said by kimbert, the local complex element had compotion set to choice though there was single element. When i changed it to sequence, the input started failing with the expected errors..!
Anyways! Special thanx to Akanksha & Kimbert for the help.
Regards,
Qadeer |
|
Back to top |
|
 |
apaaar |
Posted: Tue Apr 08, 2008 2:01 am Post subject: |
|
|
Newbie
Joined: 04 Feb 2008 Posts: 7
|
Set
Content Validation = open for complex types |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 08, 2008 2:46 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
apaar said:
Quote: |
Set
Content Validation = open for complex types |
That's not a useful comment. For most users, it is plain wrong. If you want to contribute, take the time to make yourself clear. |
|
Back to top |
|
 |
|