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 » Convert CSV to XML message

Post new topic  Reply to topic
 Convert CSV to XML message « View previous topic :: View next topic » 
Author Message
javaforvivek
PostPosted: Tue Mar 23, 2004 1:01 am    Post subject: Convert CSV to XML message Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

Hi All,
I have a comma separated file. I want to convert it to XML file. I have the DTD ready with me. The sample data is:
Vivek,Puranik,WBIMB,5000
John,Smith,WMQ,3000

This data is in the file named custinfoind.csv
I will put the data in the form of message using java for WMQ. I am writing filename as one string literal to MQMessage object and rest of the data at one shot to MQMessageObject.

THE conversion should be as follows:
<FILENAME>custinfoind.csv</FILENAME>
<CUSTINFO ACTION="ADD">
<CUSTOMER>
<FIRSTNAME>Vivek</FIRSTNAME>
<LASTNAME>Puranik</LASTNAME>
<PRODUCT>WBIMB</PRODUCT>
<QUOTE>5000</QUOTE>
</CUSTOMER>
<CUSTOMER>
<FIRSTNAME>John</FIRSTNAME>
<LASTNAME>Smith</LASTNAME>
<PRODUCT>WMQ</PRODUCT>
<QUOTE>3000</QUOTE>
</CUSTOMER>
</CUSTINFO>
This data will then be inserted into a MSSQL database.
How can I do it by using built-in nodes?
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Tue Mar 23, 2004 4:33 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You need to build a message set that describes both the CSV physical format of your data AND the XML physical format of your data.

Then you need to write a message flow that will convert the format of the message from the CSV physical format to the XML physical format, and then insert the appropriate data into your database.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Tue Mar 23, 2004 5:00 am    Post subject: Which node can I use for this?? Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

Thanks Jefff,
Which node can I use to do this in my message flow?? a Mapping Node or Compute Node??
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Tue Mar 23, 2004 6:10 am    Post subject: Re: Which node can I use for this?? Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

javaforvivek wrote:
Thanks Jefff,
Which node can I use to do this in my message flow?? a Mapping Node or Compute Node??


I don't think the mapping node alone will do a database insert, but either one will change the format of your message.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
javaforvivek
PostPosted: Tue Mar 23, 2004 11:30 pm    Post subject: How to put message on a queue?? Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

I want to put the same data using customized Java client. My data is in file named custinfoind.csv.
This client will read the data from file, line by line; grouping each line in a pair of braces ("{ }"). So that my message looks like:

{custinfoind.csv}{Vivek,Puranik,WBIMB,5000}{John,Smith,WMQ,3000}.....

The XML conversion of this data must look like this:

<FILENAME>custinfoind.csv</FILENAME>
<CUSTINFO ACTION="ADD">
<CUSTOMER>
<FIRSTNAME>Vivek</FIRSTNAME>
<LASTNAME>Puranik</LASTNAME>
<PRODUCT>WBIMB</PRODUCT>
<QUOTE>5000</QUOTE>
</CUSTOMER>
<CUSTOMER>
<FIRSTNAME>John</FIRSTNAME>
<LASTNAME>Smith</LASTNAME>
<PRODUCT>WMQ</PRODUCT>
<QUOTE>3000</QUOTE>
</CUSTOMER>
</CUSTINFO>

What MQMD settings I have to make to MQMessage object?
How should I define my TDS and XML physical formats in a message set??
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Convert CSV to XML message
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.