SFTP ConfigurationThe adapter accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the adapter, access to these internal properties is provided through the Other property.
SFTP Configuration Settings
|DeleteOnSuspend: Specifies whether files may be deleted from server when message is suspended.If true, the file on the server will be deleted in accordance with the option selected in DeleteMode even if the message is suspended.
The default value is False.
|DownloadCacheFile: When set, only new files will be downloaded from the server.This may be set to the location of a file on disk that will hold the names of files that were previously downloaded from the server. On each PollingInterval the adapter will check to see if the file on the server exists in this list. If the file exists in this list, it is determined that the file was previously downloaded and is not downloaded on the current polling interval. The list is automatically updated on each polling interval.|
|IgnoreFileMaskCasing: Instructs the adapter to ignore casing of when FileMask is set. By default the value of this setting is false. If set to true the adapter will ignore case when matching a value to the FileMask.|
|FilePermissions: Specifies the permissions of a file to be set after a successful upload.
This may be set to an octal value representing the permissions of a file to be set after a successful upload. For example:
FilePermissions=0777Note: When using the SCP adapter this must be a 4 digit value. The SFTP adapter will accept a 3 digit value.
|LocalFile: Specifies the local file to upload or download.This setting overrides the overrides the default behavior of the adapter,
causing it to ignore the normal message data and upload the file indicated.
Likewise, the parsed local filename is used instead of the value in the RemoteFile property.
This may also be set to a local directory when Download is set to True in the send adapter.
|MaxFileData: Specifies the maximum payload size of an SFTP packet.
While the SSH specification requires servers and clients to support SSH packets
of at least 32000 bytes, some server implementations limit packet size to smaller
values. MaxFileData provides a means by which the user can specify the maximum
amount of data that can be put into an SFTP packet so that the adapter can
communicate effectively with these servers. If you are having difficulty when
uploading to a server, try setting MaxFileData size to value smaller than 32000.
Most servers that use smaller values will use a maximum SSH packet size of 16KB (16384). In order to most efficiently communicate with such servers, MaxFileData size should be set to 14745.
|MonitorFileGrowth: Specifies whether the adapter checks for file growth before downloading.If set to "TRUE" the adapter will store the file sizes of the remote files
between polling intervals. If the file size does not change between polling
intervals it will be downloaded and removed from the list. Otherwise it will
be skipped for that interval.
For example, if this option is set to TRUE, the adapter would do the following
on the first two polling intervals:
Interval 1: The adapter will record the file size of the remote files.
Interval 2: The adapter will compare the recorded file size with the current file size of the remote files. If the file size has not changed then the adapter will download the file. If the file size has changed then the adapter will record the new file size but take no other actions.
|ProtocolVersion: The highest allowable SFTP version to use.This governs the highest allowable SFTP version to use when negotiating the version with the server. The default value is 3 as this is the most common version. The component supports values from 3 to 6. It is recommended to use the default value of 3 unless there is a specific reason a higher version is needed.|
|ListDirBeforeDownload: Determines if the directory is listed on download.This is True by default. When set to False the adapter will not list the directory before attempting a download. This may only be used when the exact name of the file is known and is specified in FileMask. This is helpful in situations where the name of the file is known and server permissions do not allow directory listings.|
|LocalEOL: When TransferMode is set, this specifies the line ending for the local system.This setting is only applicable when TransferMode is set to 1 (ASCII).
The default value is a CrLf character sequence.
When uploading or downloading this value will be compared to ServerEOL. If ServerEOL and LocalEOL are different, the line endings in the file being transferred will be converted to the line endings used by the destination. Line endings will be converted to the value in LocalEOL when downloading. Line endings will be converted to the value in ServerEOL when uploading. If ServerEOL and LocalEOL are the same, no conversion takes place.
The value supplied to this setting should contain a C# .NET style character sequence:
TransferMode=1 LocalEOL=\r\ n
|ServerEOL: When TransferMode is set, this specifies the line ending for the remote system.This setting is only applicable when TransferMode is set to 1 (ASCII).
The default value is a CrLf character sequence.
When uploading or downloading this value will be compared to LocalEOL. If ServerEOL and LocalEOL are different, the line endings in the file being transferred will be converted to the line endings used by the destination. Line endings will be converted to the value in LocalEOL when downloading. Line endings will be converted to the value in ServerEOL when uploading. If ServerEOL and LocalEOL are the same, no conversion takes place.
The value supplied to this setting should contain a C# .NET style character sequence:
TransferMode=1 ServerEOL=\r\ n
|TransferMode: The transfer mode (ASCII or Binary).The value 0 represents Binary and the value 1 represents ASCII. If the value is 0 (default), the initial server mode will be used.
Note: When this value is set to 1 (ASCII) and ProtocolVersion is set to 4 or higher the adapter will automatically determine the value for ServerEOL if the server supports the "newline" protocol extension.
|RenameTo: A filename to which RemoteFile will be renamed.After downloading a file, the file on the server may be renamed using this setting. This rename action will take place
after the batch submission to BizTalk. If you need to perform actions on a file before this, use the AfterGet property.
This setting is used in conjunction with RenameMode to conditionally rename a file. For instance, to rename a
file after it has been successfully submitted to BizTalk set the Other property of the adapter like so:
RenameTo=%SourceFileName%.doneMacros such as %SourceFileName% are supported as in the given example. A full list of supported macros can be found at the bottom of this section.
|RenameMode: The condition under which RenameTo is used.This setting controls when the value specified by RenameTo is used. If RenameTo is not specified, this setting has no impact. By default, downloaded files are only renamed after being successfully submitted to BizTalk (a value of 1).
Possible values are:
|TemporaryDownloadExtension: An extension to be appended during download.During download, it may be necessary for the file on the server to be renamed. After the download is complete the file will be renamed back to the original name.|
|TemporaryUploadExtension: An extension to be appended during upload.During upload, it may be necessary for the RemoteFile to be written to a temporary file name. For example, some business process may be set up to expect a specific file extension. Using this setting will allow the adapter to upload the file without the remainder of the process attempting to pick up the incomplete file.|
|LogSSHPackets: If True, detailed SSH packet logging is performed.This setting can be enabled to assist in debugging. When set to True the adapter will include detailed information about the SSH level packets in the log. The default value is False.|
|SSHAcceptServerHostKeyFingerPrint: Instructs the adapter to accept the server's host key with this fingerprint.This may be set to a comma-delimited collection of 16-byte MD5 fingerprints that should be accepted as the host's key. You may supply it by HEX
encoding the values in the form "0a:1b:2c:3d". Example:
|SSHEncryptionAlgorithms: A comma-separated list containing all allowable compression algorithms.During the SSH handshake, this list will be used to negotiate the encryption algorithm to be used between the client and server. This list is used for both directions: client to server and server to client.
At least one supported algorithm must appear in this list. The following encryption algorithms are supported by the component:
The default value is "aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,arcfour256,arcfour128,arcfour,cast128-cbc,email@example.com,firstname.lastname@example.org".
|SSHKeyExchangeAlgorithms: Specifies the supported key exchange algorithms.This may be used to specify the list of supported Key Exchange algorithms used during SSH negotiation. The value should contain
a comma separated list of algorithms. Supported algorithms are:
|SSHMacAlgorithms: Specifies the supported Mac algorithms. This may be used to specify an alternate list of supported Mac algorithms used during SSH negotiation. This also specifies the order in which the Mac algorithms are preferred.
The value should contain a comma separated list of algorithms. Supported algorithms are:
|DownloadSingleFile: If set to true, the send adapter will download a file instead of upload.This setting is used to download a file from an orchestration using the send adapter. It is only applicable to the send adapter. In situations where you want to
initiate the download of a file instead of using a receive adapter you can configure the send adapter to download the file.
In this case the adapter should be used as a solicit response adapter. Because a solicit response port can return only one
message, you can only download one file at a time with the SFTP, SCP, and FTP send ports.
To do this you'll need to set the DownloadSingleFile configuration setting to true. For instance:
Message_2 = Message_1; Message_2(nsoftware.BizTalk.SFTP.SSHUser) = "test"; Message_2(nsoftware.BizTalk.SFTP.SSHPassword) = "test"; Message_2(nsoftware.BizTalk.SFTP.SSHHost) = "server"; Message_2(nsoftware.BizTalk.SFTP.SSHAcceptServerHostKeyAcceptAny) = true; Message_2(nsoftware.BizTalk.SFTP.RemotePath) = "temp"; Message_2(nsoftware.BizTalk.SFTP.RemoteFile) = "test.txt"; Message_2(nsoftware.BizTalk.SFTP.Other) = "DownloadSingleFile=true";
Note: You can also set DeleteAfterDownload in the Other property for FTP and SFTP transfer to delete the file on the server once the download is complete.
DeleteAfterDownload is not applicable to SCP.
This can be done by setting one configuration setting per line in the Other property:
Message_2(nsoftware.BizTalk.SFTP.Other) = "DownloadSingleFile=true\r\nDeleteAfterDownload=true";
It is also possible to download multiple files with the send adapters. To do this you can not use a solicit response port. You must use a one way send port. In this case set the LocalFile setting to the directory to which you'd like to download the files and set Download to true.
|Download: If set to true, the send adapter will download files instead of upload.This setting is used to download multiple files using the send adapter. It is only applicable to the send adapter. In situations where you want to
initiate the download of files instead of using a receive adapter you can configure the send adapter to download the files.
It is similar in use to DownloadSingleFile.
To do this you can not use a solicit response port. You must use a one way send port. In this case set the LocalFile setting to the directory to which you'd like to download the files.
|DeleteAfterDownload: If set to true, deletes the file after download.This setting is used in conjunction with either Download or DownloadSingleFile. It is only applicable to the send adapter. When the send adapter is configured to download a file this setting can also be specified to delete the file from the server after it is downloaded.|
|ListDirectory: If set to true, the send adapter will list the directory instead of upload.This setting is used to list the files in a remote directory on the server from an orchestration using the send adapter.
It is only applicable to the send adapter. In situations where you want to list the contents of a directory you
can configure the send adapter to do so.
In this case the adapter should be used as a solicit response adapter. In your orchestration after referencing the
SFTP or FTP adapter you can set the message context properties to configure the adapter.
To specify that the adapter should list the directory set the Other property to ListDirectory=true. For instance:
Message_2 = Message_1; Message_2(nsoftware.BizTalk.SFTP.SSHUser) = "test"; Message_2(nsoftware.BizTalk.SFTP.SSHPassword) = "test"; Message_2(nsoftware.BizTalk.SFTP.SSHHost) = "server"; Message_2(nsoftware.BizTalk.SFTP.SSHAcceptServerHostKeyAcceptAny) = true; Message_2(nsoftware.BizTalk.SFTP.RemotePath) = "temp"; Message_2(nsoftware.BizTalk.SFTP.RemoteFile) = "*.txt"; Message_2(nsoftware.BizTalk.SFTP.Other) = "ListDirectory=true";The solicit response port will return a message with a body containing an XML formatted representation of the directory contents. For instance:
<Directory name="temp"> <Directory name="subDir1"/> <Directory name="subDir2"/> <File name="file1.txt"> <Size>size</Size> <Time>time</Time> </File> <File name="file2.txt"> <Size>size</Size> <Time>time</Time> </File> <File name="file3.txt"> <Size>size</Size> <Time>time</Time> </File> </Directory>
Note: The SFTP adapter returns additional CTime and ATime elements representing the CreationTime and AccessTime. CreationTime is only supported on servers that support SFTP protocol version 4 or higher. To enable the adapter to use version 4 or higher you can set ProtocolVersion to "4".
General Configuration Settings
|AbsoluteTimeout: Determines whether timeouts are inactivity timeouts or absolute timeouts.If AbsoluteTimeout is set to True, any method which does not complete within Timeout seconds will be aborted. By default, AbsoluteTimeout is False, and the timeout is an inactivity timeout.|
|LocalHost: The name of the local host or user-assigned IP interface through which connections are initiated or accepted.The LocalHost configuration contains the name of the local host as obtained by the Gethostname() system call, or if the user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the adapter initiate connections (or accept in the case of server adapters) only through that interface.
If the adapter is connected, the LocalHost configuration shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).
|TcpNoDelay: Whether or not to delay when sending packets.
When true, the socket will send all data that is ready to send at once. When
false, the socket will send smaller buffered packets of data at small intervals.
This is known as the Nagle algorithm.
By default, this config is set to false.
|UseManagedSecurityAPI: Tells the adapter whether or not to use the system security libraries or a managed implementation.
By default the adapter will use the system security libraries to perform cryptographic functions. This means
calls to unmanaged code will be made. In certain environments this is not desirable. To use a completely managed security
implementation set this setting to True. Setting this to True tells the adapter to use the internal managed implementation
instead of using the system's security API.
Note that when this value is set the product's system dll is no longer required as a reference, as all unmanaged code is stored in this file.
Connections Configuration Settings
|PersistedConnectionTimeout: How long to leave a persisted connection alive.If persisted connections are enabled and PersistedConnectionTimeout is set to a positive value, the connection will be kept alive for that number of minutes after a message transmission. If no other messages are sent over that connection during the timeout period, the adapter will disconnect from that server.
Note: the default value is 0. This value means that the connection will be kept alive unless the server disconnects it due to idling.
The adapter also supports the following Macros. These values are not case sensitive and would be supplied to a property in the form %MacroName%.
|Temp||This is resolved to the full path to the system's temporary directory.|
|MessageID||Globally unique identifier (GUID) of the message in BizTalk Server.|
|SourceFileName||The original file name. This includes the extension and excludes the file path, for example, Sample.xml|
|SourceFileNameNoExt||The original file name without the extension or file path, for example, Sample|
|RemoteFileName||The name of the file as it was uploaded to the remote server. This includes the extension and excludes the file path, for example, Sample.xml. Valid only for AS3, FTP, and SFTP Send Adapters.|
|DestinationParty||Name of the destination party.|
|DestinationPartyQualifier||Qualifier of the destination party.|
|SourceParty||Name of the source party.|
|SourcePartyQualifier||Qualifier of the source party.|
|DateTime:CustomFormat||This special value allows you to specify your own custom time format. For instance DateTime:yyyy would be resolved to the 4 digit year.|
|Date||The date format yyyy-MM-dd.|
|DateTime||The date format yyyy-MM-ddThhmmss.|
|Time||The date format hhmmss.|
|DateTime_BTS2000||The date format yyyyMMddhhmmssf.|
|DateTime.TZ||The date format yyyy-MM-ddThhmmsszzz.|
|Time.TZ||The date format hhmmsszzz.|