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 » How do i validate the DTD against the incoming message

Post new topic  Reply to topic
 How do i validate the DTD against the incoming message « View previous topic :: View next topic » 
Author Message
venugp
PostPosted: Fri Sep 13, 2002 1:24 pm    Post subject: How do i validate the DTD against the incoming message Reply with quote

Apprentice

Joined: 03 Sep 2002
Posts: 31

Hi,
I have a scenario where i have to validate the XML structure for incoming message in to the message flow how the broker validates that and is there any way we can see in developement process.

If i define a message set with one structure in MRM, if the incoming message doesn't have all the XML segemnts matching to DTD which i added for structure validation in MRM what would happen?

Is there any way i can refer to the fields in compute node , the input message doesn't have those fileds by defining importing the DTD in to the message set and adding it to broker.

Please help me some body so that i can save lot of time with respect to my task.

Thanks,
venu.
Back to top
View user's profile Send private message
ernest-ter.kuile
PostPosted: Tue Sep 17, 2002 3:25 am    Post subject: Reply with quote

Apprentice

Joined: 13 May 2002
Posts: 49
Location: KLM Holland

As far as I know there is no way (yet) in the broker to check an incomming xml message against a dtd.

You can always repars it using an MRM as you can import an DTD to produce a MRM. But using the MRM parser is quite time consuming (per message), the XML parser seems to be much faster (at least on z/OS).

Quote:
If i define a message set with one structure in MRM, if the incoming message doesn't have all the XML segemnts matching to DTD which i added for structure validation in MRM what would happen?


As xml allows optional elements, and so does MRM, I expect the MRM parser will, just as expected, mark them as such and not complain.

As to check for the existence or absence of an optional XML elements (or attributes), wel you can alway check in a compute or filter node if they are not NULL before accessing them :

Code:
IF InputRoot.XML.Element1.Element2 IS NOT NULL THEN
    handle Element2;
ELSE
    handle absence of element2;
END IF;


If an element should have been there is the first place I will forgo these tests and count on the exception mechanism to pull me out.

hope this helps.
Back to top
View user's profile Send private message Visit poster's website
venugp
PostPosted: Tue Sep 17, 2002 1:42 pm    Post subject: Reply with quote

Apprentice

Joined: 03 Sep 2002
Posts: 31

I read in the manual we can validate the DTD against incoming message uby defining the in coming structure as message set and assigning it to broker.

Message set domain and message set identifier and message identifier and format needs to be mentioned in input queue.
I am not whether i can validate the incoming message like this or is some other things i have to do.

Any help is appreciated.
Thnaks,
venu.
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Sep 17, 2002 3:26 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

venugp wrote:
I read in the manual we can validate the DTD against incoming message uby defining the in coming structure as message set and assigning it to broker.


I think you could do this in CSD3. There are some additional attributes defined in MQInput node for message validation. So far I have not used it myself .. so I am not sure about it.
_________________
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
View user's profile Send private message Visit poster's website
ernest-ter.kuile
PostPosted: Wed Sep 18, 2002 12:38 am    Post subject: Reply with quote

Apprentice

Joined: 13 May 2002
Posts: 49
Location: KLM Holland

venugp wrote:
I read in the manual we can validate the DTD against incoming message by defining the in coming structure as message set and assigning it to broker.

Message set domain and message set identifier and message identifier and format needs to be mentioned in input queue.
I am not whether i can validate the incoming message like this or is some other things i have to do.


Yep, this is what I meant when I said you could import a DTD to make a MRM out of it, and this isn't something new from CSD3, by the way.

What you cannot do is have the xml parser do it. And beside, the resulting MRM is not a complete image of the DTD. The process only works with simple DTDs and some of the possible elements from the DTD are not known to the MRM parser. Ordering inside the xml message becomes fixed, and default values are not added to the MRM tree view if absent from the xml message.

I still believe this isn't really necessary, I have to admit I'm a strong believer the incomming message should be correct in the first place. And beside, by accessing/handling your xml message you will at the same time check it for consistancy. The XML parser will check your message really is XML, and access to the necessary elements (or attributs) will generate an exception if they are absent.

Of course this is specifically our problem, as I said the MRM parser isn't really a speed daemon, the system needs to handle a lot of messages and z/OS is payed by the CPU tick.

I do recommend (and I expect you already did this) you check this out your self by importing your DTD in the system and testing the result.

Ernest.
Back to top
View user's profile Send private message Visit poster's website
aks
PostPosted: Wed Sep 18, 2002 10:45 pm    Post subject: Reply with quote

Voyager

Joined: 19 Jul 2002
Posts: 84

With CSD03, I turned validation on in a compute node that receives an XML message and it validates nicely against the DTD that I imported into a message set. However, I had to use MRM xml and not self-defining xml in my ESQL transform statements.

What I can't get to work is validating the xml after it has been transformed from a commarea. The trace says it can't find an element that I know is there. When I turn off validation off, no problem.

Alan
Back to top
View user's profile Send private message
AlexeiSkate
PostPosted: Mon Dec 16, 2002 2:05 pm    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2002
Posts: 123

Can someone tell me what CSD stands for. Thanks.
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Dec 16, 2002 9:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

CSD stands for Cumulative Service Distribution.
_________________
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
View user's profile Send private message Visit poster's website
kwelch
PostPosted: Wed Aug 20, 2003 10:00 am    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 255

Ernest,

I tend to agree with you but we have some customers that are insisting we validate the dtd. We have explained to them we can do that in the code by checking for the presence of required fields but because we are getting the XML from outside of our company they are concerned that changes will be made to the format of the message and we won't pick them up. They will then be passed on to their application and bomb. So....we are attempting the validate with little success either on the input or compute. They want us to validate incoming and outgoing. Can you explain what you mean by simple DTD's. What would be an example of something that is too complex to validate? Thanks!

Karen
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How do i validate the DTD against the incoming 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.