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 » Reading multiple xml files through same Input Node

Post new topic  Reply to topic
 Reading multiple xml files through same Input Node « View previous topic :: View next topic » 
Author Message
rakesh ginjupalli
PostPosted: Wed Sep 10, 2014 5:04 am    Post subject: Reading multiple xml files through same Input Node Reply with quote

Newbie

Joined: 10 Sep 2014
Posts: 2

HI,

I have requirement where an application will drop an xml into a queue. There are five different schemas for this xml and the input xml can be any one of those.

Now based on the type of xml that came in, I need to parse the xml and trigger the corresponding flow.

How can i do this.

No information reg the type of xml is present in the MQMD or MQRFH2.

If it is xpath, do you have any sample codes for the same.
I assume based on the name of root element we need to route the flow.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 10, 2014 5:17 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The XMLNSC parser will use the root tag of the message to identify the schema to use to parse the message.

The rest is a simple exercise in broker programming.
Back to top
View user's profile Send private message
vicentius
PostPosted: Wed Sep 10, 2014 5:21 am    Post subject: Reply with quote

Apprentice

Joined: 01 Mar 2013
Posts: 28

Use the XMLNSC parser on the MQInput node. It will create a representation of the body even without knowing the XML Schema. Later in the flow, you can identifying the type of message you received based on the name and namespace info of the firstchild of Body.XMLNSC tree.

Later edit: What the Grand Master said...
Back to top
View user's profile Send private message
Simbu
PostPosted: Wed Sep 10, 2014 11:11 pm    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

Adding to that, your message model schema files should be in your application and library.
Back to top
View user's profile Send private message
rakesh ginjupalli
PostPosted: Thu Sep 11, 2014 1:40 am    Post subject: Reply with quote

Newbie

Joined: 10 Sep 2014
Posts: 2

Thanks for your replies. The information is very useful.

I am planning to look for a specific tag and its value which is common to all the xmls (schemas) and then based on that i will route to the corresponding flow.

For that , I am thinking of using Xpath.
My only confusion is whether to use a route node, or java compute node or manipulate using ESQL code.
(Note : at this point i dont know which xml came in, even though the parser may have parsed with its corresponding schema).


Please correct me if my approach itself is wrong.
Back to top
View user's profile Send private message
vicentius
PostPosted: Thu Sep 11, 2014 2:41 am    Post subject: Reply with quote

Apprentice

Joined: 01 Mar 2013
Posts: 28

Sounds promising. Please do come back and let us know what you did and how it worked out.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Sep 11, 2014 3:14 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The FIELDNAME Function in ESQL can set a variable to the name of a field/tag.
If you are routing based upon the name of the 'root' tag then 2 or 3 lines of esql will do the trick.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Sep 11, 2014 4:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

smdavies99 wrote:
The FIELDNAME Function in ESQL can set a variable to the name of a field/tag.
If you are routing based upon the name of the 'root' tag then 2 or 3 lines of esql will do the trick.


Or you put an XPath in a Route node and don't use code at all.

Horses for courses, different strokes, any number of other aphorisms....
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Reading multiple xml files through same Input Node
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.