/n software Adapters for BizTalk

Questions / Feedback?

SFTP Configuration

The 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

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.

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.

DeleteOnUploadError:   Whether to delete the remote file when an error occurs after upload begins.

If an error occurs after an upload has started, the partial upload may remain on the remote server after the error is handled. If this setting is True, the send adapter will delete the partial upload while handling the error. The default value is False.

This is only applicable to the send adapter.

DisableRealPath:   Controls whether or not the SSH_FXP_REALPATH request is sent.

This configuration setting can be used to skip sending the SSH_FXP_REALPATH request, which asks the server to canonicalize the value in RemotePath to an absolute path. The default value is false, which will cause the component to send the request normally. If set to true, component will not send the SSH_FXP_REALPATH packet and will use the value in RemotePath directly.

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.

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.

DownloadCacheFileDuration:   The number of minutes that a file name will remain in the download cache.

If a file name is added to the DownloadCacheFile and is not seen on the server again within DownloadCacheFileDuration minutes, it will be removed from the cache. This can prevent the download cache file from growing too large in certain cases.

The default value is 0, meaning that files will never be removed.

This setting is only applicable if DownloadCacheFile is set.

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, FTP, and WebDAV 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, SFTP, and WebDAV transfers 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.

EnableFileDetailsComparison:   Whether the receive adapter should consider metadata differences when deciding whether to download a file again.

This setting is used in conjunction with DownloadCacheFile, and is only available on the receive adapter. If DownloadCacheFile is enabled, this setting can be used to control how the receive adapter uses the download file cache information when deciding whether to download a file again. (Similar to the "Enable Timestamp Comparison" property on Microsoft's FTP BizTalk Adapter.)

If this is set to False, the receive adapter will not download a file again if the cache contains any information about it (that is, if it has been downloaded before).

If this is set to True, the receive adapter will check the metadata of the remote file against its cached metadata, and will download the file again if any of the metadata differs.

ExcludeMask:   Instructs the adapter to exclude some files when downloading.

This configuration setting is used to specify a mask to exclude certain files when downloading. If a file matches both this mask and FileMask, the file will be not be downloaded.

FileMaskDelimiter:   Specifies a delimiter to use for setting multiple file masks.

If specified, the file mask will be split into separate masks based on the chosen delimiter. The default is "", which will cause the file mask to be treated as a single value. When using multiple masks, any files that match one or more of the masks will be downloaded. For example, setting FileMaskDelimiter to "," and setting RemoteFile to "*.txt, *.csv" will download all files ending in .txt or .csv.

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=0777
Note: When using the SCP adapter this must be a 4 digit value. The SFTP adapter will accept a 3 digit value.
IgnoreEmptyFiles:   Instructs the adapter to ignore empty files when downloading.

When this option is true the adapter will ignore any empty files when downloading from the server.

The default value is false.

Note: This is only applicable to the Receive adapter.

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.

KeyRenegotiationThreshold:   Sets the threshold for the SSH Key Renegotiation.

This property allows you to specify the threshold, in the number of bytes, for the SSH Key Renegotiation. The default value for this property is set to 1 GB.

Example (for setting the threshold to 500 MB):

SSHComponent.Config("KeyRenegotiationThreshold=524288000")

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.

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, FTP, or WebDAV 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 (The exact set of elements may vary depending on the adapter). 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".

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

Conversion will only happen when TransferMode is set to 1 (ASCII) and ServerEOL and LocalEOL are different.

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.

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.

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.

MaxFilesPerPollingInterval:   The maximum number of files that will be downloaded from the server during a single poll.

By default, the adapter will download all available files (matching any filemasks) when polling the target directory. To limit the number of files that will be downloaded in a single poll, set this to the maximum number.

Note that to avoid downloading the same subset of files each poll, either DownloadCacheFile or DeleteMode should also be used.

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.

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:

1 (OnSuccess - default)The file is renamed using the value in RenameTo only after the message is successfully submitted to BizTalk.
2 (OnFailure)The file is renamed using the value in RenameTo only after the message submission to BizTalk fails.
3 (Always) The file is renamed using the value in RenameTo regardless of the message submission result.

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%.done
Macros 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.
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

Conversion will only happen when TransferMode is set to 1 (ASCII) and ServerEOL and LocalEOL are different.

SortCriteria:   Determines sort order before downloading files.

By default, files will be downloaded in the order in which they were listed by the server. When set to a value other than 0, this configuration setting will cause the adapter to sort the list of files before downloading. Only applies when ListDirBeforeDownload is true (default). Valid values are:

  • 0 - Disabled
  • 1 - Name, ascending
  • 2 - Name, descending
  • 3 - Date, ascending
  • 4 - Date, descending
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:

SSHAcceptServerHostKeyFingerprint=0a:1b:2c:3d
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:

aes256-cbc256-bit AES encryption in CBC mode
aes192-cbc192-bit AES encryption in CBC mode
aes128-cbc128-bit AES encryption in CBC mode
3des-cbc192-bit (3-key) triple DES encryption in CBC mode
aes256-ctr256-bit AES encryption in CTR mode
aes192-ctr192-bit AES encryption in CTR mode
aes128-ctr128-bit AES encryption in CTR mode
3des-ctr192-bit (3-key) triple DES encryption in CTR mode
cast128-cbcCAST-128 encryption
blowfish-cbcBlowfish encryption
arcfourARC4 encryption
arcfour128128-bit ARC4 encryption
arcfour256256-bit ARC4 encryption
aes256-gcm@openssh.com256-bit AES encryption in GCM mode.
aes128-gcm@openssh.com128-bit AES encryption in GCM mode.

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,aes256-gcm@openssh.com,aes128-gcm@openssh.com".

SSHFingerprintHashAlgorithm:   The algorithm used to calculate the fingerprint.

This configuration setting controls which hash algorithm is used to calculate the certificate's fingerprint. Valid values are:

  • MD5 (default)
  • SHA1
  • SHA256
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:

  • curve25519-sha256
  • curve25519-sha256@libssh.org
  • diffie-hellman-group1-sha1
  • diffie-hellman-group14-sha1
  • diffie-hellman-group14-sha256
  • diffie-hellman-group16-sha512
  • diffie-hellman-group18-sha512
  • diffie-hellman-group-exchange-sha256
  • diffie-hellman-group-exchange-sha1
  • ecdh-sha2-nistp256
  • ecdh-sha2-nistp384
  • ecdh-sha2-nistp521
The default value is: curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha256,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,ecdh-sha2-nistp256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp384,ecdh-sha2-nistp521.
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:

  • hmac-sha1
  • hmac-md5
  • hmac-sha1-96
  • hmac-md5-96
  • hmac-sha2-256
  • hmac-sha2-256-96
  • hmac-sha2-512
  • hmac-sha2-512-96
  • hmac-ripemd160
  • hmac-ripemd160-96
  • hmac-sha2-256-etm@openssh.com
  • hmac-sha2-512-etm@openssh.com
The default value is hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5,hmac-ripemd160,hmac-sha1-96,hmac-md5-96,hmac-sha2-256-96,hmac-sha2-512-96,hmac-ripemd160-96,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com.
SSHPublicKeyAlgorithms:   Specifies the supported public key algorithms.

This setting specifies the allowed public key algorithms. This list controls only the public key algorithm used when authenticating to the server. This list has no bearing on the public key algorithms that can be used to authenticate the client. The default value is ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,rsa-sha2-512,ssh-rsa,ssh-dss,x509v3-sign-rsa,x509v3-sign-dss.

This setting specifies a list of signature algorithms that may be used when authenticating to the server using public key authentication. This applies only when public key authentication is performed by the client.

The setting should be a comma separated list of algorithms. At runtime the adapter will evaluate the specified algorithms and if the algorithm is applicable to the certificate specified in SSHCert it will be used. If the algorithm is not applicable the adapter will evaluate the next algorithm. Possible values are:

  • ssh-rsa
  • rsa-sha2-256
  • rsa-sha2-512
  • ssh-dss
  • ecdsa-sha2-nistp256
  • ecdsa-sha2-nistp384
  • ecdsa-sha2-nistp521
  • ssh-ed25519
  • x509v3-sign-rsa
  • x509v3-sign-dss

The default value in Windows is ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519.

rsa-sha2-256 and rsa-sha2-512 notes

The adapter will query the server for supported algorithms when connecting. If the server indicates support for rsa-sha2-256 or rsa-sha2-512 and the algorithm is present in the list defined by this setting (as in the default value), that algorithm will be used instead of ssh-rsa even when ssh-rsa appears first in the list.

For the rsa-sha2-256 and rsa-sha2-512 algorithms to be automatically preferred the server must support the ext-info-c mechanism. In practice, older servers do not support this and in that case ssh-rsa will be used since it appears first in the list. Newer servers do support this mechanism and in that case rsa-sha2-256 or rsa-sha2-512 will be used even though it appears after ssh-rsa.

This behavior has been carefully designed to provide maximum compatibility while automatically using more secure algorithms when connecting to servers which support them.

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.

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.

When this value is set to 1 (ASCII) the adapter will use the values specified in LocalEOL and ServerEOL to convert line endings as appropriate.

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.

WaitForServerDisconnect:   Causes the component to wait for the server to close the connection.

When this is set to True, the adapter will wait for the server to close the connection after operation is complete instead of closing the connection immediately. This helps prevent ports on the system from being left in the TIME_WAIT state. The default is False.

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.

UseInternalSecurityAPI:   Tells the adapter whether or not to use the system security libraries or an internal implementation.

By default the adapter will use the system security libraries to perform cryptographic functions. When set to False 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 implementation instead of using the system's security API.

Note: This setting is static. The value set is applicable to all adapters used in the application.

When this value is set the product's system DLL is no longer required as a reference, as all unmanaged code is stored in that file.

Supported Macros

The adapter also supports the following Macros. These values are not case sensitive and would be supplied to a property in the form %MacroName%.

TempThis is resolved to the full path to the system's temporary directory.
MessageIDGlobally unique identifier (GUID) of the message in BizTalk Server.
SourceFileNameThe original file name. This includes the extension and excludes the file path, for example, Sample.xml
SourceFileNameNoExtThe original file name without the extension or file path, for example, Sample
RemoteFileNameThe 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.
DestinationPartyName of the destination party.
DestinationPartyQualifierQualifier of the destination party.
SourcePartyName of the source party.
SourcePartyQualifierQualifier of the source party.
DateTime:CustomFormatThis special value allows you to specify your own custom time format. For instance DateTime:yyyy would be resolved to the 4 digit year.
DateThe date format yyyy-MM-dd.
DateTimeThe date format yyyy-MM-ddThhmmss.
TimeThe date format hhmmss.
DateTime_BTS2000The date format yyyyMMddhhmmssf.
DateTime.TZThe date format yyyy-MM-ddThhmmsszzz.
Time.TZThe date format hhmmsszzz.
Property#<Schema>#<Name>This special value allows you to include a property from the incoming message. For instance "PROPERTY#http://schemas.microsoft.com/BizTalk/2003/system-properties#ReceivePortName" would resolve to the ReceivePortName property of the message.

Copyright (c) 2022 /n software inc. - All rights reserved.
/n software Adapters for BizTalk - Version 20.0 [Build 8319]