Wednesday, May 7, 2008

Setup Local FTP Server for BizTalk 2006 FTP Adapter Development

Today, I was asked by my colleague to find out more about BizTalk 2006 FTP Adapter, because we may use that for future projects.

Setup my local PC with Windows XP Professional SP 2

1. Windows XP comes with built in FTP Site under the IIS Installation, you can install them through Add or Remove Programs -> Add/Remove Windows Component.
You can follow the steps from Mark Salloway's post and Mike D.'s article for FTP overview.

2. Open Computer Management -> System Tools -> Local Users & Groups -> Users

3. Create a new local user named FTPUser with the password

4. Create a folder named BizAppFTP and several subfolders :

  • In -> Receive Location
  • Out -> Send Port
  • Log -> FTP Adapter Log Folder
  • Sample -> Contain sample files for input
Right click on the BizAppFTP Folder -> Properties -> Security Tab -> Add FTPUser into the list and allow modify access.

5. Open Computer Management -> Services and Application -> Internet Information Services -> FTP Sites -> Default FTP Site

6. Create a virtual directory named BizApp and set the path to the previously created BizAppFTP folder. Check Read, Write, and Log visits options for the virtual directory.

7. Open BizTalk Server 2006 Administration Console

8. Create a one-way receive port named rp_TestFTP and a receive location rl_TestFTP and configure the adapter
  • File Mask : *.xml
  • Folder : BizApp/In
  • Log : D:\Temp\BizAppFTP\Log\Receive.Log
  • Password : (Fill this with FTPUser password)
  • Server : (Your server name / IP Address)
  • User Name : FTPUser

9. Create a send port named sp_TestFTP and configure the adapter
  • Folder : BizApp/Out
  • Log : D:\Temp\BizAppFTP\Log\Send.log
  • Password : (Fill this with FTPUser password)
  • Server : (Your server name / IP Address)
  • User Name : FTPUser

10. Set the filter expression for the sp_TestFTP to subscribe the message from rp_TestFTP receive port.

Testing Time

1. Create a sample xml file in then sample folder with only inside.
2. Copy and paste the file into the "In" folder

3. Depends on the polling interval, it will pick up the file through rl_TestFTP and then send the file directly to the "Out" folder through sp_TestFTP.

4. The output file was generated and if you can see the Receive.Log and Send.Log for the FTP activities.
Similar to FILE adapter, the adapter will try to get the file and delete the file, this is why you will need to have a user who has privilege to delete the file and by using this built in FTP, the security can be configured through NTFS.

You may want to read more on the FTP Adapter in the BizTalk documentation, especially on the security part where it mentions "FTP is, by nature, not secure: The user name, password, and other credentials traverse the network in clear text".

I'll post more later when I have the project at hand.
Hope this helps :)

5 comments:

Anonymous said...

I've been struggling with an FTP receive location the whole day. The big problem is, I can see the adapter connecting ,issuing the LIST comand (successfully lists files), but the FTP adapter never issues the "RETR" command. I've checked privileges on the folder/files and even allowed Everyone "Full Control". Very strange.

Bembeng Arifin said...

Hi,
I assume that you can see the adapter connecting, etc from the biztalk log files?
But yes, it's a bit weird to see that if it's able to list down all the files (*.xml) but didn't trigger the RETR command.
You probably want to re-check whether the security setup on step#4 and step#6 have been defined.

Bembeng Arifin said...

btw, if you're testing using UNIX, not using windows FTP server, you can see whether you had this problem below.
http://bembengarifin-tech.blogspot.com/2008/06/watch-out-for-that-blank-space.html

vitamin b12 said...

Thanks for sharing the useful information on FTP server.These command has helped me to use the FTp server extensively.

Venu said...

Amazing article....perfect .....to the Point....
Thank u so much for sharing this

Post a Comment