none
Custom File Adapter - ReceivedFileName RRS feed

  • Question

  • Hello,

    We needed to create a zero byte file adapter to handle incoming (empty) signal files. We've based this custom adapter on the file adapter found in the sdk samples.

    From this file we wanted to use the name of the file in an orchestration. (This is the only "data" that the file has.) Afterwards we also want to use the macro %SourceFileName% in the send port (which uses a normal File adapter). 

    So it basically needs to have the same functionalities of FILE.ReceivedFileName, but in our custom adapter. How can we go about to implement this?

    Thank you!

    Thursday, June 6, 2013 6:46 AM

Answers

  • In the PickupFilesAndSubmit(of the SDK sample) you have the FileInfo of your file, that FileInfo contains your FileName.

    Once you have crated your IBaseMessage based on the File, you will need to promote that FileName into the ReceivedFileName property.

    ex: msg.context.Promote("ReceivedFileName","http://schemas.microsoft.com/BizTalk/2003/file-properties", "YOURFILENAME");


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    • Marked as answer by Sorbjar Thursday, June 6, 2013 11:27 AM
    Thursday, June 6, 2013 7:36 AM

All replies

  • In the PickupFilesAndSubmit(of the SDK sample) you have the FileInfo of your file, that FileInfo contains your FileName.

    Once you have crated your IBaseMessage based on the File, you will need to promote that FileName into the ReceivedFileName property.

    ex: msg.context.Promote("ReceivedFileName","http://schemas.microsoft.com/BizTalk/2003/file-properties", "YOURFILENAME");


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    • Marked as answer by Sorbjar Thursday, June 6, 2013 11:27 AM
    Thursday, June 6, 2013 7:36 AM
  • The BizTalk File Adapter does not promote the "ReceivedFileName" but rather just "Write" it (Not Promoted). So calling msg.Context.Write should be sufficient.

    Morten la Cour

    Thursday, June 6, 2013 9:26 AM
  • we made it work with msg.Context.Write

    thanks for the feedback both of you, much appreciated.

    Maarten Duvé

    Thursday, June 6, 2013 10:41 AM