on 04-03-2015 11:35 AM
Hi Experts,
We have a scenario where we are sending a message from ECC to receiver interface. We are using SFTP adapter at the receiver side. The file structure is in the following format. We need to convert the xml to flat file. So how to convert the XML to flat file. We are using the advantco.com SFTP adapter. We are able to create Header1 and trailer but details tab is missing.
Input XML
<RecordSet>
<Header1>
<A1>11</A1>
<A2>22</A2>
</Header1>
<Detail>
<Header2>
<B1>123</B1>
<B2>234>/B2>
</Header2>
<Header3>
<C1>aaa</C1>
<C2>bbb</C2>
</Header3>
</Detail>
<Trailer>
<D1>a11</D1>
<D2>b22</D2>
</Trailer>
end of recordset
Output file
1122
123234
aaabbb
a11b22
Thanks,
Srinivas.
Hi Srinivas,
I got the required output with below FCC parameters in MessageTransformBean.
Sample File:
<?xml version="1.0" encoding="utf-8"?>
<ns0:FileSenderData xmlns:ns0="urn:ch:test:prototype">
<RecordSet>
<Header1>
<A1>11</A1>
<A2>22</A2>
</Header1>
<Detail>
<Header2>
<B1>123</B1>
<B2>234</B2>
</Header2>
<Header3>
<C1>aaa</C1>
<C2>bbb</C2>
</Header3>
</Detail>
<Detail>
<Header2>
<B1>2123</B1>
<B2>2234</B2>
</Header2>
<Header3>
<C1>2aaa</C1>
<C2>2bbb</C2>
</Header3>
</Detail>
<Trailer>
<D1>a11</D1>
<D2>b22</D2>
</Trailer>
</RecordSet>
</ns0:FileSenderData>
Receiver File:
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hareesh,
Normally Details node is for representing the multiple occurrence of Header2 and Header3 combinations, if any fields directly under details segment we can place them those fields in separate segment called Header4 and we can use them in RecordSet structure because these fields we need to place them in separate line in the file.
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
The structure level is more then 3 (in detail segment Recordset/Detail/Header2/Fields) and you can not use the message tranform bean or content conversion for this structure to flat file.
I would suggest to use Java map or convert the structure to simple 3 level structure, then use the content conversion in receiver adapter.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.