Skip to Content

XI in the role of a FTP

This weblog tries to explain and answer some of the queries (ex. Re: Using XI as FTP without mapping , Using XI as a FTP Server ? etc) from the forum where the requirement was to make XI as a FTP to transfer files.  The trick # involved is to use a combination of  1. A Generic content conversion or Avoid Content Conversion (See Update Section Below)2. No Mapping and 3. Adapter Specific Message Properties (most of the case you will need the same file name at the target end too) Avoiding content conversion will make the scenario more generic. Hence any file irrespective of its file type can be picked up by the File Adapter. You can ignore the screenshots of the file adapter configurations (Sender and Receiver) and refer the UPDATE section to configure it to pick and post files irrespective of its type. To acheive the Generic content conversion an assumption is made that every file has it’s end Separator as a new line (which i believe is a standard norm we encounter).  For example my test file is as follows:  01,TYPE,DATE,30032006 02,SHABZ,T-SYS,XITEAM 02,ANISH,T-SYS,XITEAM 02,ALBY,T-SYS,ABAPTEAM 02,RATHEESH,T-SYS,ABAPTEAM 03,TRAILER  The field separator might be different for other files and even the number of fields. The file can also be a fixed field length type. So we configure our file adapter to pick any file suiting the criteria so that it picks the file irrespective of its field separator or it being a fixed field length type but keeping in ming that each record in file would be separated by a new line. You can also have a look at Configuring Generic Sender File CC Adapter weblog which employs the same logic as we are going to implement here. The Data type created is as follows; (It will be of the Record-Row kind, the content conversion of which will be shown later) In case of avoiding the Content Conversion, we can use a dummy Data type and its corresponding Message type. This dummy message type can be hence used in the message interfaces.image The following is its corresponding Message Type. image Now the trick is in the creation of the message interface. Use the same message type created in both the outbound and inbound message interface.Outbound Message Interface:imageInbound Message Interface:image Do not create any Mappings and hence no interface mapping too.  In the Configuration we look at the Sender and Receiver File Adapter configurations. Sender File Adapter#:Refer the UPDATE section to configure the File Adapter without content conversionimageReceiver File Adapter#:Refer the UPDATE section to configure the File Adapter without content conversionimage The rest of the configuration is done as in any normal scenario except that we wouldnt specify an interface mapping during the creation of the interface determination. image Once saved and activated our scenario should be up and running.  Note: In order to get the functionality of the same file name in the destination refer The specified item was not found. weblog (SP14 and above)  #UPDATE : Do refer the discussion (comments) below.   As JK mentioned, we can avoid the whole content conversion itself by using the Message protocol as ‘File’. This will pick any file may it be a .txt, .pdf, .doc or .xls (and much more) extension. As I mentioned earlier, in combination with the adapter specific message properties (SP 14 and above), we can get the same file name/file extension of the source at the target side too. Try a minor change to the File Adapter configuration as shown below ; Sender File Adapter :  Message Protocol : File File Name : *.* In Adapter specific message properties : Enable File Name & File Type Receiver File Adapter :  Message Protocol : File File Constuction Mode : Create In ‘Adapter specific message properties’ : Enable File Name & File Type  Thus the restriction on the file structure can be avoided.   And in case of large files to be FTPed we could try the approach suggested by Mike A New Approach: Have a look at this latest How to send any data (even binary) through XI, without using the Integration Repository which talks of even avoiding the IR completely for such a scenario. 
You must be Logged on to comment or reply to a post.
  • To get the same file in the receiver side, you have a reference blog, and it talks about using UDFs in mapping program to extract the file name.
    I beleive using XI just as an FTP tool will still need a mapping and so may be limited only to CSV files with standard line seperators and not to any unstructured document.


    • I agree totally to you. The whole thing has a limitation.

      But in case of files to be FTP’ed, if they come with a standard of being line separated i guess we can indeed avoid mapping and there in making the interface generic.

      Thanx for your comments.


      • Michal
              You have suggested use of BPM and java proxy to do the file transfer. Could you outline the steps to do this on the XI framework ? Also, do we need a BPM at all ? Could you elaborate ?

        Thanks for your time and suggestions. Waiting for your reply.

        • Michal
                Thanks for the reply. One basic question – when you say Java proxies – do we still use the file/ftp sender adapter to poll for certain file/ftp locations and then the IS passes on the file to the java proxy – java proxy takes over from there to send the file the destination ?

          Is my understanding of your solution correct ? If so, will a huge file not be a bottleneck on the IS ?

          Thank you for your time.

      • Hi Shabarish,
        I am new to this XI world.I tried this file to file mapping and I have taken dummy data type as u have suggested.Now after configuration scenario is activated I am able to see the file which is transferred succesfully.But I am not able to understand the purpose of taking a dummy data type and message type.So can u please explain that in the same thread or to .Actually was trying to understand how XML and SOAP messages are generated in this case.when I go to runtime workbench to see the adapter monitoring,I see the following error when I try to see the payload in “message content” tab.
        “Invalid at the top level of the document. Error processing resource …”
        Inspite of this error the file is transfered succefully to the FTP server.
        Please provide help on this which will make it simpler to understand as to how XI internally creates the XML document and processes it.
        Thanks in advance…
        • No mapping – Are u sure ? >> yes 🙂
          check to c what have u specified in you file adapter – >

          Sender File Adapter :

          Message Protocol : File
          File Name : *.*
          In Adapter specific message properties : Enable File Name & File Type

          Receiver File Adapter :

          Message Protocol : File
          File Constuction Mode : Create
          In ‘Adapter specific message properties’ : Enable File Name & File Type

  • Hi Shabarish,
         Even you dont have to do a content conversion. You can take the protocol for the file as ‘FILE’ and it will do a file transfer as is what is existing in the file. For the same file name from SP15 onwards we can use the adapter specific message attributes.


  • Hi,

    the best (fastest) way to move files
    is to…use a BPM for example 🙂
    but for sure avoid using the file adapter

    if your files are big and you just need
    to move them then use java proxies
    this way the transfer will be dramatically
    faster – just imagine file adapter
    moving a 200mb file…. with java proxy
    you simply copy it in a few minutes or less
    try doing the same with file adapter 🙂

    so the described example may be good
    but only for very small files

    (bpm is of course only used to initialize the proxy but you don’t have to use it)


    • Thnx Mike and JK !!!
      I really appreciate your inputs.

      I guess i sud have mentioned the ‘FILE’ message protocol instead of content conversion, really can avoid that hurdle. Point noted 🙂

      I need to try out the Java Proxy approach. (I M not much of a Java guy 🙂 ) !!!

      Seems i need to update this weblog now that you experts have pitched in your voice !!!

      • hi Shabarish,

        it’s not about being a java guy:)
        I’m not a java guy too but when
        I see how the file adapter works with simple file
        without any mapping at all 
        I know has to be a faster approach…
        and in many cases pure java is the answer 🙂


        • Hi Mike,

          Yeah … actually i tried to test the scenario without the content conversion and a 150 MB file passed thru (it took some time though 🙂 ) and then i got a bit too ambitious and tried with a 250 MB wmv file … and the next thing i knew was my XI server going down 🙁


    • Hi Michal
               Could you just give an outline of how you go about doing the file transfer using java proxies and also intializing the java proxy using BPM ( why is BPM required for this )

      Thank you for your valuable suggestions.

    • Hi Michal,

      In this scenario, are you suggesting not use file adapter for both sender and receiver? or only receiver?

      1. If sender and receiver is a java proxy how easy to do the polling and etc??
      2. If receiver is a java proxy- the proxy classes and its signature will be generated based on the message Type but if I am not doing content conversion how can I pass the file to java Proxy?

      Thanks in advance…


  • Shabrish, the update you have at the end of the blog is not in sync with the blog’s 3 tricks mentioned above. suggest u move it to draft , update and then make it final so that ppl do not get confused(the blog talks about content conversion in file adapter with screen shots, but the final conclusion here is to use message protocol as FILE and not “content conversion” which is in total contradiction).

    From what i understand , we choose the message protocol as file, so Now what should be the Message Type chosen in the outbound interface & inbound interface ? Can it be any dummy Message Type ? if i understood rite , the Message Type can be anything and need not be what is mentioned in the blog(!!).
    Good to know that any file , be it structured or unstructured can be handled using this irrespective of the SP i am in rite.
    Now, if i am less than SP15 , the only restriction is i will not be able to get the same file name on the receiver side. If i am on SP15 or above, we just check adapter specific attributes on the sender & receiver FTP adapters and automaticaly there is a correlation established b/w sender & receiver FTP adapters, something like file name of 1st file read by sender will be sent HIDDEN(!!) to the receiver file adapter and it will write with the exact file name without ANY mapping used. very nice feature this one is.
    Any idea if we have MULTIPLE RECIEVER adapters configrued , all of them will write with the same name on the receiver side ?


    • Hi Saravana,

      Yes your understanding is correct, but about the Multiple Receivers i need to confirm the same. Will update you once i get the info via mail.


      PS: I have mda some more changes in the blog, so that the situation is more clear.