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 IndexWebSphere Message Broker SupportValidate XML against XSD

Post new topicReply to topic
Validate XML against XSD View previous topic :: View next topic
Author Message
saviobarr
PostPosted: Thu Mar 09, 2017 6:50 am Post subject: Validate XML against XSD Reply with quote

Voyager

Joined: 21 Oct 2014
Posts: 82
Location: Sao Paulo, Brazil

Hi everyone,
I have a HTTP Input, which receives a XML message. I have to validate the incoming message agains a xsd, but I saw no HTTP Input property where I can provide the xsd. I tried the "Message Model" property, by typing xsd name. It didn go thru.
I went thru the KC, but I could not find the information.

Do you guys have a suggestion?

Kind regards,

Savio Barros
_________________
Go as far as you can go. Then go farther!
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Mar 09, 2017 6:53 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17190

Add the xsd to your application/service/whatever. Tell the HTTPInput node to use the XMLNSC parser.

As long as the XSD describes the document that you receive, it will validate.

If you want to validate content as well as structure, you need to alter the properties of the HTTPInput node to "Content and Value"...
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
saviobarr
PostPosted: Thu Mar 09, 2017 7:07 am Post subject: Reply with quote

Voyager

Joined: 21 Oct 2014
Posts: 82
Location: Sao Paulo, Brazil

Hi, thanks for replying

mqjeff wrote:
Add the xsd to your application/service/whatever. Tell the HTTPInput node to use the XMLNSC parser.

The xsd is already in the application and the HTTInput node is set to parse the incoming message to XMLNSC domain.

mqjeff wrote:

As long as the XSD describes the document that you receive, it will validate.

If you want to validate content as well as structure, you need to alter the properties of the HTTPInput node to "Content and Value"...

Don't I have to tell to HTTPInput node which xsd it must use to validate the incoming message?

Many thanks

Savio
_________________
Go as far as you can go. Then go farther!
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Thu Mar 09, 2017 7:19 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17190

You don't have to tell the node which XSD to use.

It will match the root tag of the XML document with the XSD that matches that tag...

So if you have a document like
Code:
<xml..> <MyDoc>...
and xsds
Code:
..<MyDoc>...
and
Code:
...<TheOtherDoc>...
, the XMLNSC parser will use the MyDoc xsd.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
saviobarr
PostPosted: Thu Mar 09, 2017 7:21 am Post subject: Reply with quote

Voyager

Joined: 21 Oct 2014
Posts: 82
Location: Sao Paulo, Brazil

Great! It worked!
Thanks again

Savio
_________________
Go as far as you can go. Then go farther!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportValidate XML against XSD
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.