I have a scenario where client drop an XML and a .FINISHED file. Client create the .FINISHED file once it’s finishes writing XML file. Both file have same name. As you can see, I can’t start reading .XML before .FINISHED created. Once XML copied to target I like to delete both files from the client location.
It looks very typical problem but I think SFTP and SSO have made it non-typical.
I am developing on BizTalk 2009 using /n software SFTP Adaptor for BizTalk with SSO for authentication.
Notes:
I have to use SFTP as I can’t use FTP protocol.
There are some solutions I have Googled and tried but all are FTP based and/or using Correlation.
I have to use SSO for managing credentials.
software SFTP Adaptor provides the feature to use SSO and it is working fine under normal scenario where I have to read/write without waiting for .FINISHED file.
I have used following approaches:
Correlation – Parallel/Sequential
After spending some time I realised that I can’t use Correlation as I have to wait for .FINISHED file before start reading .XML. Client starts writing XML first and then FINISHED
When I drop the .XML receive location picks the file without waiting for .FINISHED and Orchestration through exception depending upon situation.
For this solution I have got help from following blog
http://www.paulvanbrenk.com/blog/CategoryView,category,BizTalk.aspx
Please correct me if I have wrong understanding.
Using a .Net Component to Get the XML File from SFTP location once .FINISHED received:
I see this as solution but I am having issues getting file from SFTP site. I have to use SSO for authentication and can’t find any .NET based SFTP solution using SSO.
For this solution I have got help from following site:
Another possible solution is to change Software or any other SFTP Adaptor’s receive location or URI within Orchestration at runtime i.e. initially set it to .FINISHED once received change it to .XML and get it.
Don’t know how to achieve it but is it possible within orchestration??
Another option with the /nsoftware SFTP adapter is to use the MonitorFileGrowth setting.
This records the size of a file between polling intervals and won't try to download the file until it has stopped increasing (so the file is no longer being written to). You can set it in the Other property of the adapter like:
Or if you have control over the process that creates the files on the server using a temporary extension for the file that doesn't match your FileMask (so the receive location won't try to download it) would also work.
Or if you want to wait for the .FINISHED file like Fabio said, you could configure the receive location to only look for .FINISHED files, and once received in your orchestration use the send adapter to download the XML file as per this article: http://www.nsoftware.com/kb/showentry.aspx?entry=09170901