Author |
Message
|
Giridhar |
Posted: Wed Dec 12, 2007 7:49 am Post subject: XML to COBOL Transformation |
|
|
 Apprentice
Joined: 23 Nov 2005 Posts: 46
|
I am trying to use the mapping node to transform XML messages to Cobol in WMB6. I have created the Message definition using a XSD and am using MRM parser. The Message format i am using is XML1.
The messages are reaching the output Queue but in a different XML format instead of in Cobol (flatfile).
Any ideas about how to make it work? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 7:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
So (to be clear) you've created a message set using an XSD which matches the input XML. You've created a message set (presumably from the copybook) that matches the flat file format you need. You've used a mapping node to transform one to the other, but the output remains XML?
You should check the Cobol message set physical definition. Or correct me if I've misunderstood.
But if I have understood correctly I would doubt a format of "XML1" would produce a flat file. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Giridhar |
Posted: Wed Dec 12, 2007 8:04 am Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2005 Posts: 46
|
I am trying the do a request - reply.
Tha Cobol to XML flow is working fine. For this I created a Message definition using a copybook that I imported.
Its only the reply flow that has to convert XML to Cobol that is not happenning. YES, I have created the message definition using an XSD which matches the XML. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 8:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Giridhar wrote: |
Its only the reply flow that has to convert XML to Cobol that is not happenning. YES, I have created the message definition using an XSD which matches the XML. |
So how is the output Cobol format produced? From the copybook as I said? Or the editor?
Are there errors from the mapping node? Is the format set correctly (like I said "XML1" is an odd name for a flat file format) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Giridhar |
Posted: Wed Dec 12, 2007 8:17 am Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2005 Posts: 46
|
Quote: |
So how is the output Cobol format produced? From the copybook as I said? Or the editor? |
For this I tried using 2 diffreent message formats, one using XML1 and the other using CWF1. I guess I will have to create a different message definition using the Cobol file as you suggested. Earlier it used to give me an error when i used it since both the XMl and the Cobol file have the same root element.
Quote: |
Is the format set correctly (like I said "XML1" is an odd name for a flat file format) |
Even I felt the same thing, so I used CWF1. It was erroring out.
Quote: |
Are there errors from the mapping node? |
No errors in the Mapping node either. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 8:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Giridhar wrote: |
I guess I will have to create a different message definition using the Cobol file as you suggested. |
If they're 2 different formats I guess you will. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Giridhar |
Posted: Wed Dec 12, 2007 8:22 am Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2005 Posts: 46
|
Did not have to when I parsed from Cobol to XML.
But I am trying your suggestion. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 8:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Giridhar wrote: |
Did not have to when I parsed from Cobol to XML.
|
I would theorise that the XML is a straightforward representation of the input flat file, but expressed as a tag document. The flat file however, is not a straightforward representation of the XML and hence you require a separate logical model in the form of a separate message set.
But that's just a theory.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Giridhar |
Posted: Wed Dec 12, 2007 2:55 pm Post subject: |
|
|
 Apprentice
Joined: 23 Nov 2005 Posts: 46
|
Thanks Vitor, your theory is right. I tried out whatever you suggested and it works fine. |
|
Back to top |
|
 |
EddieA |
Posted: Wed Dec 12, 2007 5:31 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Did you select the correct Domain, on the Properties page of the output MessageSet. The Mapping Node uses that to determine what format to use.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|