ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MRM Parsing

Post new topic  Reply to topic
 MRM Parsing « View previous topic :: View next topic » 
Author Message
RichA
PostPosted: Fri Sep 30, 2005 7:17 am    Post subject: MRM Parsing Reply with quote

Centurion

Joined: 14 Mar 2002
Posts: 102

I have XML messages similar to these (simplified)

1.
<SYSMSG>
<ELEMENT/>
</SYSMSG>
<SYSDATA>
<DATA1>
<DATA1.1/>
</DATA1>
</SYSDATA>

2.
<SYSMSG>
<ELEMENT/>
</SYSMSG>
<SYSDATA>
<DATA1>
<DATA2/>
</DATA1>
</SYSDATA>

I'm trying to model this in the MRM using a single message set so I have -
two types SYSMSG & SYSDATA which make up the two high level elements. SYSDATA has a DATA1 tag with a wildcard element where the lower level tags are, this will parse fine.
However what I want to do is define two different messages, one with DATA1.1 tag and another with DATA2 tag, then have them parsed (by different message flows of course), is what I'm trying to do possible or should I be approaching this differently?
I have run up against a couple of problems trying to do this, one being I'm trying to have Duplicate XML name for global elements. (The Logical names are different, but it still complains that the physical names are the same.) Another is trying to create a new complex type derived from the existing base type SYSDATA, deriving by extension doesn't allow me to add elements below the root of that type, I'm not sure how the deriving by restriction works.
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Fri Sep 30, 2005 7:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can do this as two different messages. I guess I'm not sure why, though.

The DATA1 elements will have to have different names and be different types. This doesn't mean that they have to have different XML Element names, in the physical format.

Alternately, you could do this as a single element where Data1 contains a CHOICE, rather than a wildcard. I don't know how much difference it makes, though (I'm not up to speed on wildcard elements). It might allow you to validate Data1.1 and Data2 better, though.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RichA
PostPosted: Sat Oct 01, 2005 1:18 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2002
Posts: 102

Well the majority of the messages I'm dealing with have this wrapper where only the lower level elements change accoriding to the function that's being called, based on the old best practices redbook each function is coming in on a different queue <system>.<application>.<function>.<sub-function> I would like to think that I can rely on the people writing the application to queue side of things to put the right messages to the right queue, in which case I could just parse based on a choice or a wildcard for the lower level element to do that in this case would successfully parse functions that were sent to incorrect queues and hence would have to be dealt with in code. My preference would be to throw them out.
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Sat Oct 01, 2005 3:32 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That makes sense.

But you could put a simple router pattern in place instead. Then they all write to one queue, and you deal out messages to the right flow based on data.

Maybe your performance requirements prevent this.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RichA
PostPosted: Sat Oct 01, 2005 6:21 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2002
Posts: 102

I did contemplate that, but I am uncertain as to the volume of messages being queued, I am told at least one of the functions is batch and as such is likely to put in excess of 5000 messages on a queue within a very short space of time. Currently we're only in development and as such I have stuck with the 5000 max queue depth, before it goes into production I'll do some performance testing, but that was one of the reasons I have stuck with separate queues per function.
Back to top
View user's profile Send private message MSN Messenger
kimbert
PostPosted: Mon Oct 03, 2005 12:42 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I have run up against a couple of problems trying to do this, one being I'm trying to have Duplicate XML name for global elements. (The Logical names are different, but it still complains that the physical names are the same.)

Same logical name with different physical names is fine. The other way round is not ( because the parser needs to be able to use the tag to uniquely identify a global element )
Quote:
Another is trying to create a new complex type derived from the existing base type SYSDATA, deriving by extension doesn't allow me to add elements below the root of that type, I'm not sure how the deriving by restriction works.

Deriving by extension should allow you to add extra elements to the complex type. Deriving by restriction means that you either remove elements/attributes, or you reduce the number of occurrences of them. Maybe you are getting confused by the way the editor displays extensions. The part within curly braces represents the inherited content, and the other members represent the extended content.
Back to top
View user's profile Send private message
RichA
PostPosted: Mon Oct 03, 2005 4:59 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2002
Posts: 102

So if I were to derive by extension do I need to add all the parent elements of the element I'm trying to add in? e.g. SYSDATA & DATA1?
I have almost had some success trying to do this, but it fails to parse correctly where it believes the message fails the minOccurs constraint for the element I have tried to extend.
I have tried to change the restraint so the minOccurs is 0 for the element in the parent type, but I still end up with the same exception.
<edit>
Curiously I have noticed it's not quite working as expected. It's actually telling me 78^<element name> has 0 instances on the logical tree, if I send a message with two of that element it then complains <element name> has 2 instances which of course doesn't fit the maxOccurs constrraint. I wonder where the "78^" is coming from? Any ideas anyone?
Back to top
View user's profile Send private message MSN Messenger
kimbert
PostPosted: Mon Oct 03, 2005 6:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
So if I were to derive by extension do I need to add all the parent elements of the element I'm trying to add in?
No - you only need to add the extended content.

Quote:
I have almost had some success trying to do this
You just got lucky - don't rely on it...

Quote:
but it fails to parse correctly

...as I was saying!
The errors regarding minOccurs and maxOccurs are caused by your type extension mistake. You have two instances of the same element within the same structure [the inherited one, and the one you incorrectly added again], and the MRM parser cannot decide how to assign the elements in the input message to the elements in the model.

Quote:
I wonder where the "78^" is coming from?
This is a quirk of the MRM diagnostic messages. All local elements have a unique integer prepended to their name, in case they have the same name as other local elements. You should ignore everything up to the '^'.
Back to top
View user's profile Send private message
RichA
PostPosted: Mon Oct 03, 2005 7:30 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2002
Posts: 102

How does it know where in the XML to parse the extended element then as it only seems possible to add extended elements at the highest level of the extended part of the message. Adding elements to anywhere below that level also adds them to the message type and thus negates my reasons for doing this.

Okay, I was being temporarily stupid and now I think I understand. Apologies and thanks for all your help. I had the wrong element as being extensible, I didn't realise I needed to create an empty type to use as the root of the changeable part of the message.

No, now I'm even more confused, if I add the type as an extendible type to the lower element of my message then I try to create a new message based using this type then I try to add to the extendible element it also adds to the type, what's the point of that?
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MRM Parsing
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.