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 » IBM MQ API Support » Reading file with XML tags and sending it to MQSeries Queue

Post new topic  Reply to topic
 Reading file with XML tags and sending it to MQSeries Queue « View previous topic :: View next topic » 
Author Message
Prakash Vasudevarao
PostPosted: Tue Apr 29, 2003 3:30 pm    Post subject: Reading file with XML tags and sending it to MQSeries Queue Reply with quote

Newbie

Joined: 28 Apr 2003
Posts: 1
Location: Salt Lake City, UT, USA

Hi All,

I have a requirement like this: -

I have a file with XML tags embedded in it. The MQ Client program that runs on each windows workstation need to read the file and put it as a single message into MQSeries Queue. Following is the sample XML layout: -
------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<compliance>
<computer name="XXX" date="04/29/03">
<info>
<detail name="os" value="Win2k" />
<detail name="lastuser" value="XXX" />
<detail name="distname" value="ws-12345" />
</info>
</computer>
</compliance>
------------------------------------------------------------------------------

I am using MQSeries v 5.3.0.2. I know that MQ Integrator can handle XML formatted messages.

My current program reads this file line and line and converts each of this file into a message.

Is there is a way to read this XML file and put as a one message in the queue by using regular MQSeries API's?

Please provide any ideas on this.

Thanks & Regards

Prakash
Back to top
View user's profile Send private message
vennela
PostPosted: Tue Apr 29, 2003 4:16 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Prakash:

What you are trying to do is very trivial.
All you have to do is read the file (may be line by line ) and keep concatenating the string. In the end when you are done reading the file put the entire string as an MQ Message.

Maybe like this
String = "";
read file
while more lines in the file
do
String = String + line read from file
read file
done
put String as MQMessage to a queue

And it doesn't matter whether the message is XML or not.

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

MQSeries.net Forum Index » IBM MQ API Support » Reading file with XML tags and sending it to MQSeries Queue
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.