on 09-02-2008 5:50 AM
Hi
I am Doing File-File Scenario.I am using FCC in the Sender File Adapter. I have defined the structure as below.
My Source Structure
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Source xmlns:ns0="http://city.net/filecopy">
<Message>
<Id>123</Id>
<Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
<Body>Helloworld</Body>
</Message>
</ns0:MT_Source_FILE>
So for the above structure, I have defined the FCC Parameters as
Document Name: MT_Source (Message Type)
Document Namespace:http://city.net/filecopy(Namespace)
Recordset Name: Message (root node)
Recordset Structure: Message,1,Head,1
Recordset Sequence: Ascending
Recordsets per message:1
Keyfield Type: string
In the Table Rows I have defined
Message.fieldFixedLengths: 3,10
Message.fieldNames: Id, Body
Message.fieldSeparator: ,
Message.endSeparator: 'nl'
Head.fieldFixedLengths: 3,8
Head.fieldSeparator: ,
Head.endSeparator: 'nl'
Head.fieldNames: Id, Filename.
My Input Text file
123,Helloworld
123,text.xml
I am Getting Output as
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_Source xmlns:ns="http://city.net/filecopy">
- <Message>
- <Message>
<Id>123</Id>
<Body>HelloWorld</Body>
</Message>
- <Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
</Message>
</ns:MT_Source>
I should get Body field after Head Structure as in the Source Structure, So Please what changes do I need to do in the Parameters Specified above to get the desired Output.
So How should I define the FCC Paramenters For Sender File Adapter ?
Any Help Would be Appreciated.
Regards,
Varun
Change this Recordset Structure: Message,1,Head,1
to Recordset Structure: ID,1,Head,1,Body,1
Edited by: Hemant Chahal on Sep 2, 2008 10:37 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Everyone,
I could Succeed to some extent.
I have defined the parameters as follows
Recordset Structure: Message,*,Head,1
Key Field Name: KZ
Key Field Type: integer
In the table, I defined the Parameters as
Message.fieldFixedLengths:1,3
Message.fieldNames:KZ,Id
Message.keyFieldValue:1
Message.keyFieldInStructure:ignore
Message.fieldSeparator:,
Message.endSeparator:'nl'
Head.fieldFixedLengths:1,3,8
Head.fieldNames:KZ,Id,filename
Head.keyFieldValue:2
Head.keyFieldInStructure:ignore
Head.fieldSeparator:,
Head.endSeparator:'nl'
Message.fieldFixedLengths:1,11
Message.fieldNames:KZ,Body
Message.keyFieldValue:3
Message.keyFieldInStructure:ignore
Message.fieldSeparator:,
Message.endSeparator:'nl'
My source text file
1,123
2,123,test.xml
3,Hello World
my output is
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_Source xmlns:ns="http://city.net/FileCopy">
- <Message>
- <Message>
<Id>123</Id>
</Message>
- <Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
</Message>
</ns:MT_Source>
I got the output almost correct except I am not getting the value in the Body
Any help would be appreciated.
Please correct me If I am wrong.
Regards,
Varun
Edited by: Varun on Sep 2, 2008 12:06 PM
Edited by: Varun on Sep 2, 2008 12:15 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arwind,
Thanks for your reply. After adding also, I am getting the same Output.
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_Source xmlns:ns="http://city.net/FileCopy">
- <Message>
- <Message>
<Id>123</Id>
</Message>
- <Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
</Message>
</ns:MT_Source>
In the above structure, Message is repeating.
Desired Output
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_Source xmlns:ns="http://city.net/FileCopy">
- <Message>
<Id>123</Id>
- <Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
<Body>Hello world</Body>
</Message>
</ns:MT_Source>
Regards,
Varun
Hi Varun,
Define BOdy as the segment under Header segment(i.e at same level) and include one more field for eg. xyz under Body segment which holds the value "Hello world".
Then follow the below procedure:
Recordset Structure: Message,1,Head,1,Body,*
Message.fieldFixedLengths: 3,10
Message.fieldNames: Id
Message.fieldSeparator: ,
Message.endSeparator: 'nl'
Head.fieldFixedLengths: 3,8
Head.fieldSeparator: ,
Head.endSeparator: 'nl'
Head.fieldNames: Id, Filename
Body.fieldSeparator: ,
Body.endSeparator: 'nl'
Body.fieldNames: xyz
Regards,
Vinod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod Reddy,
Thanks for you reply, If there is a field under body, then It would have been much easy as you said. but there is no field under body. I cant change the structure. Actually, My source file contains only the value in the Body filed. i.e "Hello world". ID, Filename should come at runtime.
for testing I am sending values for ID and filename also.
Regards,
Varun
Hii,
for Body, what values do I need to define in the table?
regards,
Varun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Varun why dont you change your structure a bit.
to
<body>
<value>abcd</value>
</body>
as in FCC it doesnt support three hierarchies.
also you specified message as subtructure as well as recordset.
in Recordset Structure you can have substructures with their occurences, you dont have to type recordset their.
otherwise recordset also would become a substructure of recordset itself
<Message>
<Message>
<Head>
You try to make your sturcture like
<Recordset>
<Substruture1>
<field>dsfd<field>
</Substruture1>
<Substruture2>
<field>dsfd<field>
</Substruture2>
<Substruture3>
<field>dsfd<field>
</Substruture3>
<Recordset>
and for this Take recordsetname as Message.
and modify your body field to substructre,
Hi Varun,
I think there is problem while mentioning ur record set structure.Just try the below way mentioned,itmay help u:
Recordset Structure: Message,1,Head,1,Body,*
Regards,
Vinod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
May u try with the defining the fcc parameters in reverse case i.e declare the head parameters first and then declare the field parameters next.. i don't know exactly whether it may solve ur problem or not.. try this option..
regards
Kishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.