FTP Adapter for AIF

In AX 2009 we have seen that there are three adapters by default File System, MSMQ and BizTalk. Recently, I created a new adapter for FTP as well.
I have re-created the WinInet class that was present in AX 4.0 but deleted in AX 2009. Well I have planned to upgrade this Adapter where-in the FTP related functions will be handled by a class outside AX (something similar to integration framework that handles all the basic functionality for each of the standard adapters).
Till then, you can use this project for FTP adapter. I have created a new class for WinInet that runs on server as the processing classes for AIF runs on server.
Note: If you are using FTP adapter then the batch AOS server that is handling the processing job should not run under NT AUTHORITY\NETWORK SERVICE credentials but a user inside AX itself.
Here is the link to project for FTP adapter:
I would like to have your feedback on the same.
Configure the FTP Adapter
Let me quickly take you through configuring the FTP adapter. Here is what you need to do:
Setup Transport Adapter
1. Go to Basic -> Setup -> Application Integration Framework -> Transport adapters form
2. Create a new record and select the AifFTPSystemAdapter from the drop-down for Adapter class.
3. Set the adapter as Active
4. Save the record and close the form
Setup Channels 
1. Go to Basic -> Setup -> Application Integration Framework -> Channels form
2. Create a new record and select the transport adapter as FTP Adapter from the drop-down for Adapter.
3. Specify the Address as the IP address of the FTP.
4. In the General tab specify User name, Password and Port for FTP. If you are using default port 21 then you can leave port as 0.
5. Save the record
6. Now if you want to specify a folder in FTP from where the AX should pick up files then click on button configure and specify the folder.
7. Create another record for Outbound direction as well as specified above.
8. Save the record and close form
9. Next you can configure end-points wherein you use the newly created adapters.

9 thoughts on “FTP Adapter for AIF

  1. Sumit,
    I have imported the adapter and compiled the application.
    When i try to select the FTP adapter from the list , i get this msg
    “Function ‘InternetOpenA’ in DLL library ‘WinINet’ has caused an exception.” .

    can you help me to fix it

    1. What is your system configuration? Which OS version do you use? Is it 32-bit or 64-bit?
      There is a potential problem in using WinNet and Kernel32 APIs on 64-bit systems. There a concept of Windows Redirection or something that might be of your interest

    1. That can be an issue. AX is a 32 bit application and there are some windows APIs that dont work without some kind of redirection. The standard folder that it tries to pick up the APIs from is syswow64 but the ones that we need are from system32.

      1. Hi Sumit,
        do you have any solutions for the above problem(redirection).i am running this code on win 2008 64 bit OS. can you please help?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s