Author |
Message
|
rvikky |
Posted: Thu Mar 23, 2006 3:33 am Post subject: CSV to XML |
|
|
Apprentice
Joined: 14 Feb 2006 Posts: 32 Location: Bangalore
|
I want to convert a message in CSV(Comma Separated Value) type to XML format. For example; "rvikky,bangalore" is the message and i want to convert it to <Details><Name>rvikky</Name><Place>Bangalore</Place></Details>
I've used a message set and message flow. message set has the target type where i have used TDS format and delimiter as ','. In compute node I've given "SET OutputRoot.Properties.MessageFormat='XML';".
This doesn't work and from my IN queue the message goes to backout requeue queue.
Someone pl. tell me the steps to do this. |
|
Back to top |
|
 |
wschutz |
Posted: Thu Mar 23, 2006 3:37 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Assuming you don't have a rfh2 header, did you set the "Default" domain (MRM) / message set / type / format on the MQInput node? _________________ -wayne |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 23, 2006 3:42 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi rvikky,
So ur getting the input as TDS and simply changing the Format to XML in a compute node,...right ?
So have you defined an XML message set ?
What have you set for the Message Type and set ID, that must be still pointing to the TDS message set....Dont copy the values from the input.
Can you also post the error from the event log...
Regards. |
|
Back to top |
|
 |
rvikky |
Posted: Thu Mar 23, 2006 3:44 am Post subject: |
|
|
Apprentice
Joined: 14 Feb 2006 Posts: 32 Location: Bangalore
|
I've set
Message Domain = MRM
Message Set = SampleSet (CD3J030002001) -thatz the name i've used
Message Type = Message
Message Format = TDS1 |
|
Back to top |
|
 |
wschutz |
Posted: Thu Mar 23, 2006 3:46 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Did you wire a "Trace" node to the "Catch" terminal? If so, post the exception thats being thrown .... _________________ -wayne |
|
Back to top |
|
 |
rvikky |
Posted: Thu Mar 23, 2006 3:50 am Post subject: |
|
|
Apprentice
Joined: 14 Feb 2006 Posts: 32 Location: Bangalore
|
there is no error in event log.
the error i get in the .mset file is
Severity Description Resource In Folder Location Creation Time
1 Element 'Name' has default TDS Length of zero. If it is used in a TDS message, that message will not be parsed successfully. Physical format: 'TDS1'. SampleDefn.mxsd Sample/SampleSet line 0 March 23, 2006 3:53:43 PM |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 23, 2006 4:03 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi rvikky,
So ur getting the error...is it stopping you from deploying the flow....I guess not from your first post...
You should use Variable length delimited to avoid getting the above error.
Now for your first issue
Quote: |
Message Set = SampleSet (CD3J030002001) |
You cannot use this,as this will make MB look for the set and cross verify with it....or otherwise you should add the XML format to the set and make another message definition in XML...
Edited:
I think I am wrong...are u running the validation on the compute...unles you did, you shouldn't have got the error...
You should try to get us some sort of error to work with...
Regards. |
|
Back to top |
|
 |
wschutz |
Posted: Thu Mar 23, 2006 4:12 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
As Elvis says, we need to see the exception being thrown:
wschutz wrote: |
Did you wire a "Trace" node to the "Catch" terminal? If so, post the exception thats being thrown .... |
_________________ -wayne |
|
Back to top |
|
 |
rvikky |
Posted: Thu Mar 23, 2006 4:28 am Post subject: |
|
|
Apprentice
Joined: 14 Feb 2006 Posts: 32 Location: Bangalore
|
I tried wiring a Trace node and gave destination as file. File is not getting created. My system became very slow after I gave
"SET OutputRoot.Properties.MessageFormat ='XML'"
Whenever I put a message in IN queue, my system almost hangs for 10 mins. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Mar 23, 2006 5:18 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
OK, here's what to do:
- Put a trace node immediately after the MQInput node, and trace ${Root}
- If the trace does not look right, change your message set until it is. We'll help if you have trouble working out what to do.
- If you need further help, post the main details of your message set here ( logical structure and TDS properties )
The output side is easy once you have parsed the input message properly.
elvis_gn wrote:
Quote: |
You should use Variable length delimited to avoid getting the above error |
No - this is a common mistake. You should be using 'All Elements Delimited' for a CSV structure. |
|
Back to top |
|
 |
JT |
Posted: Thu Mar 23, 2006 5:27 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Quote: |
I tried wiring a Trace node and gave destination as file. File is not getting created. |
Your level of WBI experience is unknown, so I'll just ask: does the broker (re: id) have permissions to write the file that you specified in the file path parameter of the Trace node. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Mar 23, 2006 9:05 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
File is not getting created. |
Try using UserTrace as your destination instead. |
|
Back to top |
|
 |
rvikky |
Posted: Thu Mar 23, 2006 7:46 pm Post subject: |
|
|
Apprentice
Joined: 14 Feb 2006 Posts: 32 Location: Bangalore
|
i'm just learning WMB and I tried converting CSV to XML. In the message set Defn. file I've given <Message><Details><Name></Name><Place></Place></Details></Message>
Message and Details are complex types and rest are strings.
It would be helpful if someone can give me the steps to convert a CSV or TDS to XML format in WMB.
I've tried trace node and it has worked. So I think the broker has the rights to write into a file. |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 23, 2006 7:51 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi rvikky,
So where do you currently stand ?
Can we look at the trace before and after the compute...
Post you code too.
Regards. |
|
Back to top |
|
 |
rvikky |
Posted: Thu Mar 23, 2006 8:09 pm Post subject: |
|
|
Apprentice
Joined: 14 Feb 2006 Posts: 32 Location: Bangalore
|
i'm not getting any output from trace node.
The code I gave in Compute node is
SET OutputRoot.Properties.MessageFormat ='XML'
I actually opened a sample and tried doing this by looking at all the steps and values given.
Sample works properly but the one created stalls my computer for around 5 mins. when i put some message into IN queue and finally the message goes to backout queue. |
|
Back to top |
|
 |
|