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 SupportDynamic Validation IN IIB

Post new topicReply to topic
Dynamic Validation IN IIB View previous topic :: View next topic
Author Message
dharvesh79
PostPosted: Tue Dec 06, 2016 12:55 am Post subject: Dynamic Validation IN IIB Reply with quote

Newbie

Joined: 06 Dec 2016
Posts: 5

Hi All,

Is it possible to validate any message dynamically in IIB. The Message model name or XSD name will be fetched from DB and it needs to be validated.

I know we can use validate node, but is there any possibility of setting the Message model name dynamically there.

One more possibility is using WSRR and i dont want to use WSRR now.

Please suggest me how to do it.
Back to top
View user's profile Send private message
adubya
PostPosted: Tue Dec 06, 2016 1:15 am Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

Use the CREATE statement with the PARSE clause + OPTIONS enabling validation to the level you require ?

http://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak04950_.htm
_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Tue Dec 06, 2016 3:07 am Post subject: Reply with quote

Guardian

Joined: 25 Aug 2015
Posts: 947

You can use CREATE...PARSE to dynamically select the message model name. But the schemas must already be deployed - you cannot dynamically *deploy* a schema to IIB.

In general, it's not a great idea to 'deploy' your XSDs to a database instead of to IIB. It gets far too easy to make uncontrolled changes.
Back to top
View user's profile Send private message
dharvesh79
PostPosted: Tue Dec 06, 2016 10:57 pm Post subject: Reply with quote

Newbie

Joined: 06 Dec 2016
Posts: 5

timber wrote:
You can use CREATE...PARSE to dynamically select the message model name. But the schemas must already be deployed - you cannot dynamically *deploy* a schema to IIB.

In general, it's not a great idea to 'deploy' your XSDs to a database instead of to IIB. It gets far too easy to make uncontrolled changes.


Is it possible for you to provide me an example of that create...parse statement.

Also i am not deploying the XSD in DB. The XSD is in IIB but the name alone dynamically fetched from DB.
Back to top
View user's profile Send private message
adubya
PostPosted: Tue Dec 06, 2016 11:27 pm Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

dharvesh79 wrote:
timber wrote:
You can use CREATE...PARSE to dynamically select the message model name. But the schemas must already be deployed - you cannot dynamically *deploy* a schema to IIB.

In general, it's not a great idea to 'deploy' your XSDs to a database instead of to IIB. It gets far too easy to make uncontrolled changes.


Is it possible for you to provide me an example of that create...parse statement.
.


I'll leave that as an exercise for the reader. The Infocentre gives examples, experiment, see how you get on and if you have problems then add them to this thread. Best way to learn
_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
dharvesh79
PostPosted: Wed Dec 07, 2016 1:00 am Post subject: Reply with quote

Newbie

Joined: 06 Dec 2016
Posts: 5

adubya wrote:
dharvesh79 wrote:
timber wrote:
You can use CREATE...PARSE to dynamically select the message model name. But the schemas must already be deployed - you cannot dynamically *deploy* a schema to IIB.

In general, it's not a great idea to 'deploy' your XSDs to a database instead of to IIB. It gets far too easy to make uncontrolled changes.


Is it possible for you to provide me an example of that create...parse statement.
.


I'll leave that as an exercise for the reader. The Infocentre gives examples, experiment, see how you get on and if you have problems then add them to this thread. Best way to learn



I tried using the Create statement.

Code:
DECLARE options INTEGER BITOR(FolderBitStream, ValidateContentAndValue,
                                    ValidateContentAndValue);
      DECLARE inCCSID INT InputProperties.CodedCharSetId;                     
      DECLARE inEncoding INT InputProperties.Encoding;                       
      DECLARE inBitStream BLOB ASBITSTREAM(InputRoot.XMLNSC, inEncoding, inCCSID);
      CREATE LASTCHILD OF Environment.Msg.NewData DOMAIN('XMLNSC')                           
             PARSE(inBitStream, inEncoding, inCCSID, 'ValdationMSET',         
                   'Employee', 'XMLNSC', options);


It created a XML under Environment.Msg.NewData but having header and no body. It says CHARACTER:XML Parsing Errors have occurred.

Now i need to check if there are any error in the xml like the above situation. Please suggest me how to proceed.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Dec 07, 2016 4:39 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

dharvesh79 wrote:
It created a XML under Environment.Msg.NewData but having header and no body. It says CHARACTER:XML Parsing Errors have occurred.


The message wasn't a proper XML document.

dharvesh79 wrote:
Now i need to check if there are any error in the xml like the above situation. Please suggest me how to proceed.

In order to find out if the XML message is valid, you have to either a) parse it, b) write your own parser.

Don't write your own parser.

Figure out what it *means* when the message is bad - is it your flow? is it the sender? Do you need to retry it? Do you need to return an error? Do you need to log something? Move the message somewhere?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
timber
PostPosted: Wed Dec 07, 2016 6:01 am Post subject: Reply with quote

Guardian

Joined: 25 Aug 2015
Posts: 947

Quote:
It created a XML under Environment.Msg.NewData but having header and no body.
The debugger displays the message tree at the point where the error occurred. If the debugger is not connected, the message flow never sees that partially-constructed message tree. The exception is thrown and control passes back up the line to the nearest Catch node/node with a Catch terminal wired up.
Quote:
Now i need to check if there are any error in the xml like the above situation
mqjeff is correct; either your XML is incorrect or you specified the wrong CCSID. But I think you are describing the next task on your list. What exactly does the requirement say? Can you just return true for 'document is valid' and false otherwise? Who is going to read the error reports emitted by your message flow?
Back to top
View user's profile Send private message
dharvesh79
PostPosted: Wed Dec 07, 2016 11:36 pm Post subject: Reply with quote

Newbie

Joined: 06 Dec 2016
Posts: 5

timber wrote:
Quote:
It created a XML under Environment.Msg.NewData but having header and no body.
The debugger displays the message tree at the point where the error occurred. If the debugger is not connected, the message flow never sees that partially-constructed message tree. The exception is thrown and control passes back up the line to the nearest Catch node/node with a Catch terminal wired up.
Quote:
Now i need to check if there are any error in the xml like the above situation
mqjeff is correct; either your XML is incorrect or you specified the wrong CCSID. But I think you are describing the next task on your list. What exactly does the requirement say? Can you just return true for 'document is valid' and false otherwise? Who is going to read the error reports emitted by your message flow?


Yes you are correct. I have done the create statement to parse it and have an invalid XML. Now i need to either true or false.

IIB flows will read the error that are emitted by this flow.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Dec 08, 2016 5:06 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you need to execute some business logic when a message fails to parse, then you need to expect an exception and catch that exception and then handle it according to the business logic.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportDynamic Validation IN IIB
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.