How do I use your BizTalk adapter dynamically or access promoted properties?
As of Version 3 and up, you can choose to configure the adapter either dynamically or by setting context properties of the message.
If you choose to use the message context properties alone you will need to create a static send port first. From your orchestration you would then need to add a reference to the adapter you'll be using. From the message assignment shape you could then do something like:
Message_2(nsoftware.BizTalk.FTP.User) = "user";
Message_2(nsoftware.BizTalk.FTP.FTPServer) = "server";
If you choose to create the port dynamically you can do something like this:
OutgoingPortName(Microsoft.XLANGs.BaseTypes.Address) = "SFTP://user@server/RemotePath/%SourceFileName%";
OutgoingPortName(Microsoft.XLANGs.BaseTypes.TransportType) = "nsoftware.SFTP 2024";
//You'll need to configure additional properties via the message context
Message_2(nsoftware.BizTalk.SFTP.SSHPassword) = "password";
For properties that are defined as their own types (like certificate and firewall properties) you will see a collection of properties available. Consult the help file for details about the type to get an idea of what to set. An example of specifying a PEM key for SSH public key authentication would be:
Message_2(nsoftware.BizTalk.SFTP.SSHCertStoreType) = nsoftware.BizTalk.SFTP.CertStoreTypes.cstPEMKeyFile;
Message_2(nsoftware.BizTalk.SFTP.SSHCertStore) = "c:\test.pem";
Message_2(nsoftware.BizTalk.SFTP.SSHCertStorePassword) = "passphrase";
Message_2(nsoftware.BizTalk.SFTP.SSHCertSubject) = "*";
Logging can be enabled like so:
Message_2(nsoftware.BizTalk.SFTP.TransportLogType) = nsoftware.BizTalk.SFTP.LogTypes.ltFile;
Message_2(nsoftware.BizTalk.SFTP.TransportLogMode) = nsoftware.BizTalk.SFTP.LogModes.lmVerbose;
Message_2(nsoftware.BizTalk.SFTP.TransportLogLocation) = "c:\\temp\\ftplog.txt";
You can also specify a value of ltEventLog for the LogType. If you do this, the TransportLogLocation should be set to the name of the event log like "Application".
Note: Before BizTalk 2006 R2 the Microsoft.XLANGs.BaseTypes.TransportType property was not available. In this case you must specify the address including the prefix of the adapter as registered with BizTalk. This includes the version number. For instance:
OutgoingPortName(Microsoft.XLANGs.BaseTypes.Address) = "SFTP2024://user@server/RemotePath/%SourceFileName%";
Version 2
Version 2 of the adapters are not dynamic, however the properties of the adapter are promoted which allows you to configure the adapter from within an orchestration.
To do so, you will first need to set the properties from the port configuration wizard to instruct the adapter to use the values set in the message context. This is done by using the property's name as a macro. For instance, for the Remote Host property of the FTP adapter, at design time you would set this value to %RemoteHost%.
From your orchestration you would then need to add a reference to the adapter you'll be using. From the message assignment shape you could then do something like:
Message_2(nsoftware.BizTalk.FTP.User) = "user";
Message_2(nsoftware.BizTalk.FTP.FTPServer) = "server";
To set enumerated properties like Firewall Type select "From Context" in the port configuration wizard. From within your orchestration you would set this promoted property by setting an integer value. See the help file for the property you're setting to find the corresponding integer representation for the value you wish to set.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.