In the comments to a previous blog post announcing the Blogical SFTP Adapter I got a question regarding the use of the SFTP Adapter in a Dynamic Send Port. The answer I was forced to give was that the SFTP Adapter did not in its current state support being used in a Dynamic Send Port. Not being one to shy away from a challenge, and eager to show we listen to feedback, I have added the artifacts and code necessary to support Dynamic Send Ports. Mikael has included my change and it will be available in the next release of the adapter to codeplex. The problem was that the adapter had no propertyschema, and so there was no way to access the properties needed from within an orchestration, and no support in the adapter for loading properties from anywhere but its configuration. It now has those things. The installer and source download now includes a propertyschema and the adapter looks at the message context if the config is null, which it will be in a Dynamic Send Port.
So, to use the SFTP adapter from your orchestration and a Dynamic Send Port, use something similiar to the below code:
DynamicSendPort(Microsoft.XLANGs.BaseTypes.Address) = “SFTP://server:22/”;
MsgOut(BTS.OutboundTransportType) = “SFTP”;
MsgOut(Blogical.Shared.Adapters.Sftp.Schemas.host) = “server”;
MsgOut(Blogical.Shared.Adapters.Sftp.Schemas.portno) = 22;
MsgOut(Blogical.Shared.Adapters.Sftp.Schemas.user) = “user”;
MsgOut(Blogical.Shared.Adapters.Sftp.Schemas.identityfile) = @”c:mysftpkeyfile.ppk”;
MsgOut(Blogical.Shared.Adapters.Sftp.Schemas.remotefile) = “OUT_%SourceFileName%”;
I’d post a full downloadable sample, but there really isn’t anything more to it then that. You should however take a look at the propertyschema, available in both the binary download and the source, to see which properties you can use.
Hi Johan,
I am facing a peculiar problem with the send port when using the SFTP Adapter.(not being used as a dynamic port) It tends to hang when 2000+ files are being sent.
Eventviewer displays errors- Unable to connect to remote host.. from time to time.
would be grateful if there are any workarounds.
Thanks
LikeLike