none
Problem Setting Up Receive Location for SFTP using BizTalk RRS feed

  • Question

  • Hi Guys,

    I have a client request to setup SFTP files from FTP server to Client location using BizTalk with the following condition.

    There will be only one FTP Receive location where multiple files will be dropped. Out of these files, files starting with TRADE*.* should be SFTP'D into Trade folder, all other files should go into OTHERS folder.

    I Currently have the following setup to achieve this. I have setup a Send Port and Receive Port with first Receive Location having file mask TRADE*.* for all the TRADE files transferred to TRADE folder on client location.

    However I am running out of ideas on how to setup SFTP for the other half of my question which is, How to specify file mask in the second receive location that tells BizTalk to pick all the files except TRADE files?

    Any help is greatly appreciated

    Many Thanks

    Bhanu




    • Edited by bhanu_nz Wednesday, July 1, 2015 4:29 AM
    Wednesday, July 1, 2015 4:24 AM

Answers

  • Hi Bhanu,

    You can do property promotion of your filename is custom Pipeline component .In this case a single SFTP receive location will take all the files from FTP receive location and publish it to message box .

    At send port you can apply filter based on the filename property , Like File.ReceivedFileName=SFTDemo.txt.

    Code for Custom Pipeline component

    string srcFileName = messageContext.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties").ToString();
                string ReceivedFileName = srcFileName.Substring(srcFileName.LastIndexOf("\\") + 1);
                if (ReceivedFileName != null)
                {
                    messageContext.Promote("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", ReceivedFileName);

    Thanks

    Abhishek

    • Proposed as answer by Ammu_Biz Wednesday, July 1, 2015 8:16 AM
    • Marked as answer by bhanu_nz Thursday, July 2, 2015 12:37 AM
    Wednesday, July 1, 2015 5:11 AM
  • Hi Bhanu ,

    The easiest option is to use  BizTalk Pipeline Component Wizard @http://btsplcw.codeplex.com/ . You can easily  create a skeleton for your Pipeline code and thus it will ease your process of development .

    You can also take reference from below MSDN blog

    http://blogs.msdn.com/b/brajens/archive/2006/11/25/how-to-develop-biztalk-custom-pipeline-components-part1.aspx

    Thanks

    Abhishek

    • Marked as answer by bhanu_nz Thursday, July 2, 2015 9:47 PM
    Thursday, July 2, 2015 3:59 AM

All replies

  • Hi,

    Similar kind of requirement is been discussed over here.

    Please go through the proposed answers, you will get some idea over there.


    Thanks, Girish R. Patil.

    Wednesday, July 1, 2015 5:03 AM
  • Hi Bhanu,

    You can do property promotion of your filename is custom Pipeline component .In this case a single SFTP receive location will take all the files from FTP receive location and publish it to message box .

    At send port you can apply filter based on the filename property , Like File.ReceivedFileName=SFTDemo.txt.

    Code for Custom Pipeline component

    string srcFileName = messageContext.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties").ToString();
                string ReceivedFileName = srcFileName.Substring(srcFileName.LastIndexOf("\\") + 1);
                if (ReceivedFileName != null)
                {
                    messageContext.Promote("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", ReceivedFileName);

    Thanks

    Abhishek

    • Proposed as answer by Ammu_Biz Wednesday, July 1, 2015 8:16 AM
    • Marked as answer by bhanu_nz Thursday, July 2, 2015 12:37 AM
    Wednesday, July 1, 2015 5:11 AM
  • Hi Abhishek,

    Thanks for the response. Could you please also let me know on how to create a Custom pipe line component as I am asked to implement this BizTalk solution with no previous experience. I googled a few sites but nothing was helpful. Can this be done via BizTalk admin console?

    Can you point me in the right direction

    Thanks

    Bhanu


    • Edited by bhanu_nz Thursday, July 2, 2015 12:38 AM
    Thursday, July 2, 2015 12:37 AM
  • Hi Bhanu ,

    The easiest option is to use  BizTalk Pipeline Component Wizard @http://btsplcw.codeplex.com/ . You can easily  create a skeleton for your Pipeline code and thus it will ease your process of development .

    You can also take reference from below MSDN blog

    http://blogs.msdn.com/b/brajens/archive/2006/11/25/how-to-develop-biztalk-custom-pipeline-components-part1.aspx

    Thanks

    Abhishek

    • Marked as answer by bhanu_nz Thursday, July 2, 2015 9:47 PM
    Thursday, July 2, 2015 3:59 AM
  • Thanks Abhishek. Will look into this

    Cheers

    Bhanu

    Thursday, July 2, 2015 9:47 PM