Author |
Message
|
goldym |
Posted: Thu Jul 14, 2005 11:25 am Post subject: MRM - Mandatory Elements |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
I have a two part question regarding the MRM.
1. I generated a messageSet from a schema. I edited the messageSet by setting the Root Tag to Trade (which is my root element) Also i have a message called Trade which is what I want to use in the MRM domain.
I just used a simple SET statement
SET Environment.Variables.ProductName = InputRoot.MRM.Trade.productName;
This failedstating no body in document. However when I removed the Root Tag setting to Trade and just left it blank I changed my SET statement to
SET Environment.Variables.ProductName = InputRoot.MRM.productName;
This seemed to work. Maybe I just am unclear of the MRM, but should Root Tag or Message be replaced by 'MRM'?
2. Is there anyway to capture DTD validation errors when you use the MRM Domain? Besides going through and doing a check on all of the mandatory elements? |
|
Back to top |
|
 |
kirani |
Posted: Thu Jul 14, 2005 3:12 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
2. Doesn't Exception list give you more detail about the error? _________________ 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 |
|
 |
kimbert |
Posted: Fri Jul 15, 2005 1:34 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
1. The behaviour which you saw is the intended behaviour. The 'Root Tag Name' property should be used only if the root tag of your message is enclosed within another tag which you don't want to see in your parsed message tree.
2. Switch on validation in the MQInput or Compute node. |
|
Back to top |
|
 |
goldym |
Posted: Fri Jul 15, 2005 8:16 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
[quote="kimbert"]1. The behaviour which you saw is the intended behaviour. The 'Root Tag Name' property should be used only if the root tag of your message is enclosed within [b]another[/b] tag which you don't want to see in your parsed message tree.
2. Switch on validation in the MQInput or Compute node.[/quote]
Kimbert,
The problem I have is that I have several XML files coming in on the same queue so I have to have the domain set to XML. And I've written all my code to use the XML domain. Do you think its too confusing to have the message come in as XML, then route it to another queue to set to use MRM domain, validate then use the Reset Content Node to use the XML domain? |
|
Back to top |
|
 |
Maverik |
Posted: Fri Jul 15, 2005 10:10 am Post subject: |
|
|
Apprentice
Joined: 14 Jun 2005 Posts: 27
|
Ur question about whether Root tag should be replaced by MRM.
Ans= Yes. The message has Properties,MQMD and MRM which in turn is the name of the Root tag.So u dont need to make reference to it.
About your XML domain usage, I dont see why you cant achieve whatever ur trying with domain as XML.Maybe if you can tell us what ur message set fields are and what ur trying to do..... |
|
Back to top |
|
 |
kimbert |
Posted: Sun Jul 17, 2005 11:57 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
The problem I have is that I have several XML files coming in on the same queue so I have to have the domain set to XML. And I've written all my code to use the XML domain. Do you think its too confusing to have the message come in as XML, then route it to another queue to set to use MRM domain, validate then use the Reset Content Node to use the XML domain? |
It depends what your requirements are. It would certainly be simpler to use the MRM domain throughout. You can handle different MRM messages on the same queue easily enough. The MRM XML parser will select the correct message definition based on the root tag of the incoming message. (specifically, it will look up the message definition whose XML Name (not Root Tag Name) is set to the incoming root tag). |
|
Back to top |
|
 |
goldym |
Posted: Mon Jul 18, 2005 4:47 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
[quote="kimbert"][quote]The problem I have is that I have several XML files coming in on the same queue so I have to have the domain set to XML. And I've written all my code to use the XML domain. Do you think its too confusing to have the message come in as XML, then route it to another queue to set to use MRM domain, validate then use the Reset Content Node to use the XML domain?[/quote]
It depends what your requirements are. It would certainly be [i]simpler[/i] to use the MRM domain throughout. You can handle different MRM messages on the same queue easily enough. The MRM XML parser will select the correct message definition based on the root tag of the incoming message. (specifically, it will look up the message definition whose XML Name ([b]not Root Tag Name[/b]) is set to the incoming root tag).[/quote]
Thanks I can't use the MRM domain, although I agree that it would be much simplier b/c i have one XML message that I was unable to create a .xsd for. |
|
Back to top |
|
 |
goldym |
Posted: Mon Jul 18, 2005 5:00 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
Does anyone know. IF I imported a .xsd file and created a messageSet and generated a message definition file. Shouldn't a missing mandatory element cause an exception. I have my compute node set to Validate (Content and Value) Failure Action (Exception). It seems to continue on processing someone normally? |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jul 18, 2005 5:44 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I think I know what your problem is. Your entire message is self-defining (i.e. not matched against the message definition).
Check that the Root Tag Name property in your message set is empty
( and check that you have re-deployed after clearing it )
Check that the XML Name property of the message is the same as the root tag of the incoming message.
Check that all types and groups in your message definition have 'Content Validation' set to 'Closed' and the 'Mixed Content' box cleared. |
|
Back to top |
|
 |
goldym |
Posted: Mon Jul 18, 2005 6:34 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
[quote="kimbert"]I think I know what your problem is. Your entire message is self-defining (i.e. not matched against the message definition).
Check that the Root Tag Name property in your message set is empty
( and check that you have re-deployed after clearing it )
Check that the XML Name property of the message is the same as the root tag of the incoming message.
Check that all types and groups in your message definition have 'Content Validation' set to 'Closed' and the 'Mixed Content' box cleared.[/quote]
Thanks for your help!
I'm not sure where to set these two:
1. Check that the XML Name property of the message is the same as the root tag of the incoming message.
2. Check that all types and groups in your message definition have 'Content Validation' set to 'Closed' and the 'Mixed Content' box cleared. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jul 19, 2005 12:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Switch to the Broker Application Development perspective.
Open your message set
The message set editor has four panes
- Navigator at top left
- Outline view at bottom left
- Properties view at top right
- Tasks/problems view at bottom right
At the bottom of the Properties pane there are two tabs - Overview and Properties. The default is 'Overview', but 'Properties' is by far the most useful. It shows the logical and physical properties for whatever is highlighted in the Outline ( bottom left) view.
So...
Open the mxsd file containing the message
Select the message in the Outline view
In the Properties pane (top right) select the 'Properties' tab
In the tree view at the left of the Properties pane, select the 'Message' node under the name of your XML physical format.
You should now see the property 'XML Name'. Check that it is the same as the root tag of your incoming XML message.
In the Outline view, select a complex type or group
In the tree view at the left of the Properties pane, select 'Complex Type' under 'Logical Properties'. You should see properties called 'Content Validation' and 'Mixed'. Check that they are set as described. |
|
Back to top |
|
 |
goldym |
Posted: Tue Jul 19, 2005 5:40 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
I made both of these changes and my message still isn't being validated. Can you think of anything else that needs to be checked? |
|
Back to top |
|
 |
goldym |
Posted: Wed Jul 20, 2005 8:44 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
The problem is that it doesn't seem anyway to force validation when your input domain is set to XML unless you are outputing the message to a queue. However In my case I was writing to a database. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 20, 2005 9:03 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't think you can validate anything other than "well-formedness" when using the XML domain. The XMLNS domain may give a little more.
But MRM-XML will let you validate everything (that's currently supported, that is ) _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 21, 2005 12:24 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Jeff is correct - the XML and XMLNS domains do not support validation against the model. But from your previous post, I thought you were switching to the MRM domain in order to get the message validated:
Quote: |
Do you think its too confusing to have the message come in as XML, then route it to another queue to set to use MRM domain, validate then use the Reset Content Node to use the XML domain? |
If you really do need validation, the answer is to parse your messages using the MRM domain. |
|
Back to top |
|
 |
|