cancel
Showing results for 
Search instead for 
Did you mean: 

FCC SFTP adapter

Former Member
0 Kudos


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.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member182412
Active Contributor
0 Kudos

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.

former_member184720
Active Contributor
0 Kudos

So left the Details node in Recordset Structure

So I assume it might not work if we have any additional fields directly under Details Segment.

former_member182412
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi Praveen,

I have tried similar type of parameters in the content conversion but not using the content conversion bean. Will it not work in the content conversion?

Thanks,

Srinivas.

former_member182412
Active Contributor
0 Kudos

Hi Srinivas,

The normal content conversion will not work for SFTP adapter you have to use MessageTransformBean to convert XML to flat file and vice-versa.

Regards,

Praveen.

former_member184720
Active Contributor
0 Kudos

Another approach -

Dimitri
Active Contributor
0 Kudos

have a look at

perhaps that could help you out

Harish
Active Contributor
0 Kudos

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