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 » Validate input XML message

Post new topic  Reply to topic
 Validate input XML message « View previous topic :: View next topic » 
Author Message
Vargheese thomas
PostPosted: Sat Dec 27, 2003 3:18 am    Post subject: Validate input XML message Reply with quote

Novice

Joined: 16 May 2003
Posts: 13

Hi,
I have a small doubt. Can someone clarify this??

How to validate an input XML?
I have the following XML:

<?xml version=1.0 ?>
<ROOT_TAG>
<TAG1> val1 <\TAG1>
<TAG2> val2 <\TAG2>
<!--The number of elements in the complex tag may vary.
It may contain one or more elements -->
<COMPLEX_TAG>
<TAG4>1<\TAG4>
<TAG5>1<\TAG5>
<\COMPLEX_TAG>
<\ROOT_TAG>

I want to check whether the XML iam getting thru input queue has the same structure as this.
Can anyone tell me how to go about this??
Also is it posssible to validate the data type of these xml tags??


Thanks
Thomas.
_________________
Thanks and regards
Vargheese Thomas
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sat Dec 27, 2003 7:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Have you looked in the manuals for information on message validation?

Have you looked in the manuals for information on Working With XML Messages?

Have you used the MRM to model any data before?

This is a basic application of using the MRM to model and validate data.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vargheese thomas
PostPosted: Mon Dec 29, 2003 2:05 am    Post subject: XML Validation Reply with quote

Novice

Joined: 16 May 2003
Posts: 13

Yes. I tried MRM.

I created a messaget set and then associated an XML format with it.

I gave this message set in the MQInput queue
and selected the validate option. That did not work.

Then for the same message set i used a check node. Even that did not work.

Is there any property that needs to be set??
_________________
Thanks and regards
Vargheese Thomas
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Dec 29, 2003 5:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What version and what CSD level are you using?

If you are using 2.1 before CSD04 (I believe) the Validation options don't really work.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
maxis
PostPosted: Mon Dec 29, 2003 9:26 am    Post subject: Reply with quote

Centurion

Joined: 25 Jun 2002
Posts: 144

hi Vic .. I too have spent many hours. But wasnt able to get MQSI to validate the incoming xml.

I did referred redbook and manuals ... still no use ...
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Dec 30, 2003 12:26 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

To repeat what Jeff said, this is definitely possible, and is a fairly simple scenario. Check the following points

1. Check that your model really does match your input message. With XML input messages, it is very easy to get a message tree containing self-defining elements (i.e. elements which were not matched against the model). Since the message itself is self-defining, its contents are not validated.
I think this is the most likely problem.

2. Check that the message set property 'Root tag name' is either empty, or is set to the correct value. It defaults to 'MRM' , but this is almost never the correct value for a customer message. If this property is incorrect, you wil get scenario (1) above.

3. Check that you have set minOccurs and maxOccurs to the correct values on all elements.

If these do not sort out the problem, please give more details about exactly what is not working.
Back to top
View user's profile Send private message
maxis
PostPosted: Tue Dec 30, 2003 6:49 pm    Post subject: Reply with quote

Centurion

Joined: 25 Jun 2002
Posts: 144

thanks for tips.

scenario .. where its failing ..
1. Its not strictly following the predefined format .. ie. if i send extra tags .. still its parsing and letting it through.
2. If I dont send any valid tag .. still its working ..

so am not able to ascertain ..what exactly its doing .. and what I'm missing.

If I see the tree ... am seeing correct message format and message type.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jan 01, 2004 4:18 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I'll emphasise this again...validation can only work if the input message can be found in the dictionary. Otherwise, the entire message will be treated as 'self-defining' and it will *not* be validated.

With XML input, it is hard to tell whether the message was parsed 'against the dictionary' or whether it was parsed as a self-defining message. The tree looks almost identical in both cases, but validation *cannot* work if the message is not matched against the dictionary.
So....did you check the 'Root Tag Name' property on the XML message set properties?

If you check all of this, and still have problems, maybe you could send me the message set project with an example message.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Validate input XML message
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.