AS2 FileName preservation

I see some confusion in folks when using the AS2 Filename Preservation enhancement done in Biztalk 2009 in terms of what context property is used for what. Here is the feature explained.

Filename Preservation is an optional profile in AS2 specification that essentially allows the recipient of the AS2 message to retrieve the filename of the MIME wrapped EDI business document and transfer the received file to its backend system using the received filename.

How we do it in biztalk?

When you are sending a message you can specify the name of the file to be filled in the MIME headers in this UI as a context property. Default value of this property is File.ReceivedFileName which is the property promoted by FILE receive port. So in the end to end scenario, name of the file received by biztalk through file receive port is transmitted across the wire in MIME headers.

On receive side we do two things with the filename in the MIME headers of the message.

1.     We write context property EDIINT.PreservedFileName. Now you can use this property anywhere you wish. For eg, in a file send port you can specify this in the desired name of the file to dump the message to.

2.     We write FILE.ReceivedFileName. This is just to make sure that in the following scenario the filename is preserved in the message we send in step (b) if you are using the default settings at send time:

a.     You AS2Receive a message with filename in MIME headers.

b.    You AS2Send this message elsewhere.


Hope this clarifies this scenario. 


Comments (2)
  1. Kris says:

    I am facing a situation where am receiving a EDI file and also XML from the same trading partner. Their AS2 identifier is the same and currently I am facing issues routing the files to different folders. Can you let me know how to do this. This is very urgent need for me.

  2. You can use the following tag in the send port of your FILE Adapter configuration to drop the message in a folder with the file name received in As2.


    Name of the file from where the File adapter reads the message. The file name includes extension and excludes the file path, for example, foo.xml. When substituting this property, the File adapter extracts the file name from the absolute file path stored in theFILE.ReceivedFileName context property. If the context property does not have a value, for example, if message was received on an adapter other than File adapter, then the macro will not be substituted and will remain in the file name as is (for example,C:Drop%SourceFileName%).

Comments are closed.

Skip to main content