Author |
Message
|
smdavies99 |
Posted: Wed Mar 22, 2006 3:45 am Post subject: XSD->MRM & Validation question |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I have a situation which is puzzling.
- The flow is sent messages in XML format.
- The Message is formatted in the sending application to an XSD
- I imported the XSD into WBI V5.0.6 and created a message set
- The flow uses a RCD node to refomat the message from BLOB to MRM XML
All is ok until the testers start throwing messages at it.
They mess around with the XML and moved one field up(nearer the root) a level and it still got parsed ok.
After the RCD is a Compute node where I do some data checking an the Validation Property is set to "Content & Value"
The XML Field which has been moved is defined in the Message Set with a MinOccurs =1 & MaxOccurs=1
Are there any obvious reasons why the message is not rejected.
Here is an example of the good XML
Code: |
<Message_Body>
<Parts_List>
<Date>2006-03-21</Date>
<Version>2</Version>
<Item>
<PartNo>232344323</PartNo>
</Item>
</Parts_List>
</Message_Body>
|
Here is the XML after the field was moved.
Code: |
<Message_Body>
<Date>2006-03-21</Date>
<Parts_List>
<Version>2</Version>
<Item>
<PartNo>232344323</PartNo>
</Item>
</Parts_List>
</Message_Body>
|
I'm probably missing something simple but at the moment its not obvious to me
/Stephen _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Mar 22, 2006 4:05 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Your messages are being parsed OK, but they are not being matched against the message definition in the message set. The entire message is self-defining. Sort that out, and I guarantee that the errors will be trapped.
Quote: |
Are there any obvious reasons why the message is not rejected |
Not yet, because I don't know exactly what your message set looks like However, as I've said many time on this forum, there are quite a few ways to accidentally avoid validating your XML message.
- The most common is to leave the message set property 'Root Tag Name' set to its default 'MRM'. This field should be empty.
- Another popular approach is to get the namespace wrong
- You might also like to check that none of your complex types are defined as having mixed content.
Let me know if you still have problems. |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Mar 22, 2006 4:06 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi smdavies99,
Got this from the infocenter.
Quote: |
Validating messages
The broker provides validation based on the message dictionaries for predefined messages. Validation, therefore, applies only to messages that you have modeled and defined to the MRM domain.
The broker does not provide any validation for self-defining messages. You can not validate messages directly against an XML DTD or XML Schema. Instead you should create the equivalent model in the MRM domain by importing your XML DTD or XML Schema using the Message Brokers Toolkit |
So are u working with MRM...
Also try making the Parsing options as immediate...could work.
Regards. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Mar 22, 2006 5:09 am Post subject: A partial solution |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Thanks for the suggestions
The Message Set RootTag is already NULL
I did find a solution that forces a parse in
http://www.mqseries.net/phpBB2/viewtopic.php?t=26477
This does work but naturally slows the whole thing down. If there is another way then I'm willing to have a look
/Stephen _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Mar 22, 2006 5:14 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi smdavies99,
The other post also spoke of parse timing...did u make it immediate and try...i was hoping that would work...
Regards. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Mar 22, 2006 9:08 am Post subject: re Parse timing |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
re:
Quote: |
The other post also spoke of parse timing...did u make it immediate and try...i was hoping that would work...
|
I'm not overly sure where to set it up. I'm not setting the message type etc at the MQInput Node but in the RDC node
/Stephen _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Mar 22, 2006 7:39 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi smdavies99,
I have moved to MB v6.0 and hence i'm not sure if the RCD in v5 has the Parse settings available
If it does, i feel it should work just as it does in the MQInput Node....
Regards. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Mar 23, 2006 1:54 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I thought you had found a solution...
Quote: |
This does work but naturally slows the whole thing down. |
Or was that just a test flow? |
|
Back to top |
|
 |
|