Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2010 Recipes : Adapters - Configuring File Sends

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/17/2011 5:08:20 PM

1. Problem

You need to send a message from BizTalk with the File adapter.

2. Solution

The BizTalk platform offers numerous options to facilitate sending files. Within the BizTalk File adapter, various send options are natively available for the user to configure. The following steps demonstrate how to configure a send port:

  1. Open the BizTalk Explorer, and create a send port that uses the File adapter.

    NOTE

    In alignment with standard BizTalk functionality, only static ports are defined to use a named File adapter.

  2. In the send port properties, under the General options, click the ellipses for the Address (URI) property. The FILE Transport Properties dialog box appears.

  3. Click the Destination Folder input box. Enter the value of the folder where you would like BizTalk Server to write the file.

  4. → Click the Copy Mode drop-down list, and ensure that the default value, Create New, is selected, as shown in Figure 1.

    Figure 1. Configuring file sends in the FILE Transport Properties dialog box

    NOTE

    The Copy Mode drop-down list offers the Create New, Append, and Overwrite options. In this recipe, we will use Create New.

  5. Click the Authentication tab, ensure that the Use These Credentials When Host Does Not Have Access to Network Share check box is unchecked.

    NOTE

    BizTalk gives you the ability to specify a different user account if the security permissions are different from the running host user account.

  6. Click OK.

3. How It Works

You can configure the File adapter either within the BizTalk Explorer (under a send port) or through code programmatically. The File adapter send configuration options encompass naming a file, using copy mode, implementing caching, and implementing security.

When naming files on the General tab of the FILE Transport Properties dialog box, you can configure a file send in conjunction with numerous macros to assist in making a file name more meaningful. For example, as shown in Figure 1, the File Name value is %MessageID%.xml. The macro, %MessageID%, will be substituted with the globally unique identifier (GUID) of the message in BizTalk Server at runtime when the file is named. This GUID comes directly from the message context property, BTS.MessageID. Please see Table 1 for a list of available macros. It is important to note you can use only these macros.

Table 1. BizTalk Macros
TypeDescription
%datetime%Sets the name of the file to the current UTC date in the format YYYY-MM-DD (example: 2010-07-01T103500).
%datetime_bts2000%Sets the name of the file to the current UTC date in the format YYYYMMDDhhmmsss (example: 201007011035234).
%datetime.tz%Sets the name of the file to the current local date plus the time zone difference from GMT in the format YYYY-MM-DDThhmmss-TZD (example: 2010-07-01T103500+700).
%DestinationParty%The name of the file would be set to whatever value is in the message context property for BTS.DestinationParty. This field is only set in certain situations, therefore this macro is rarely used.
%DestinationPartyQualifier%The name of the file would be set to whatever value is in the message context property for BTS.DestinationPartyQualifier. This field is only set in certain situations, therefore this macro is rarely used.
%MessageID%The most commonly used macro. This sets the name of the file equal to the unique identifier of the message. Using this macro guarantees that the name of the file will always be unique.
%SourceFileName%The file will be named after the value in the FILE.ReceivedFileName context property. This property is only set if received by a File adapter. If the value is not available, the macro will name the file the actual string value of %SourceFileName%.
%SourceParty%The name of the source party (if available) from the BTS.SourceParty context property. This macro is rarely used.
%SourcePartyQualifier%The name of the source party (if available) from the BTS.SourcePartyQualifier context property. This macro is rarely used.
%time%Sets the name of the file to the current UTC time in the format hhmmss (example: 103523).
%time.tz%Sets the name of the file to the current local time plus the time zone difference from GMT in the format hhmmss-TZ (example: 103523+700).

Currently, the product does not support creating custom or user-defined macros, and it doesn't support using any other BizTalk context properties other than what is available via the macros. Using these file-naming macros has been described as somewhat problematic within the BizTalk user group community. It is worth noting that a macro will fail if the following is true:

  • A corresponding system property is not set, for example, the exclusion of SourceParty or SourcePartyID.

  • The file send macro is misspelled (including case-sensitive considerations).

  • The value of the macro result causes an invalid file name, for example, the usage of the following characters:

    / \ ! . , * " |

A further consideration when using the File send adapter is to ensure the security/access permissions are set appropriately. This encompasses standard Active Directory security considerations for related share and folder permissions, as well as security considerations related to non-Windows environments. By default, the File adapter write activity uses the user account of the running BizTalk host. It is always a good idea to unit test a security scenario first to ensure a file can be written to the desired destination before introducing the File send adapter. This way, you can isolate permission issues, saving possible issue detection and resolution time.
Other -----------------
- Administering an Exchange Server 2010 Environment : Understanding Archiving
- Administering an Exchange Server 2010 Environment : Understanding Journaling
- Administering an Exchange Server 2010 Environment : Recipient Configuration
- Windows Server 2003 : Creating and Managing Digital Certificates - Managing Certificates
- Windows Server 2003 : Creating and Managing Digital Certificates - Designing a Public Key Infrastructure
- Windows Server 2003 : Creating and Managing Digital Certificates - Introducing Certificates
- SharePoint 2010 : Mastering the Library Tab from the Ribbon (part 2)
- SharePoint 2010 : Mastering the Library Tab from the Ribbon (part 1) - Creating and Managing Views
- Windows Server 2008 R2 : Windows Media Services - Hosting a Directory of Videos for On-Demand Playback
- Windows Server 2008 R2 : Windows Media Services - Broadcasting Stored Single Files
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server