Page 1 of 1

XSD validation for Messages from MQ

Posted: Mon Apr 16, 2012 5:03 am
by Aquilis
Hi All,

Have to do XSD validation for Messages subscribed from the MQ.
What are pre-requistes for this?
like -
1. Where to keep the XSD file for Validation to happen, since Messages doesn't exist on any physical Path?

Kind Regards-

Posted: Mon Apr 16, 2012 6:58 am
by eostic
The validation is done via the xmlInput Stage, or, if you are on 8.5.x or 8.7, with the xml stage.....in the former, the xsd is stored somewhere on the DataStage server and pointed to within the header of the incoming document (it's "possible" the it may find the xsd via url, but there were issues with this in early 8.x and I haved tried it in awhile)......in the latter, the stage is defined at design time with the xsd, which you import via the library manager.

Both methods are options for you if you are in 8.7 or 8.5 with the right patches.

Learn how validation works with the xml stage types before you include mq into the mix. Test with a sample xml in a flat file and read it with the folder atage or external source stage, depending on your job type.

Ernie

Posted: Mon Apr 16, 2012 10:54 am
by Aquilis
XMLInput Stage works when XSD fname included in XML file header and same XSD is placed under XML Data file location(physically lying on ETL server) .
But for MQ, Messages will be in MQ server and how XML Input stage will detect the XSD? from which Location it will pull in even though it's mentioned in header.

Concern is, where to keep XSD file when Messages are subscribed from MQ.

Posted: Mon Apr 16, 2012 11:31 am
by eostic
The Stage only works when the name of the xsd is "in" the header....after you read the payload from MQ, run it thru a transformer and "zap" the correct xsd into it. If you are using xmlInput, that's the only way to do it. If the messages are not "too" big, it should be fine. If they get really large, you could run into column size issues --- check also some of the APT variables that are needed for large buffer sizes on links.

Ernie