%SourceFileName% 宏只能与 http://schemas.microsoft.com/BizTalk/2006/sftp-properties 命名空间一起使用

The %SourceFileName% macro can only be used with the http://schemas.microsoft.com/BizTalk/2006/sftp-properties namespace

概览

我有一个自定义发送端口管道组件,它用特定的文件掩码格式替换映射到发送管道上的文件的文件名。管道代码采用 ReceivedFileName 属性 并对其应用转换。这个过程已经运行了一年多,但是在部署了一个新的模式和地图资源之后,管道已经停止运行了。由于以下警告和错误,我现在没有创建任何文件。我希望有人可能有过类似的经历,可以让我深入了解这个问题。

注意:地图和模式在不使用管道时有效(新的和旧的)。映射和模式工件的唯一变化是添加了 2 个 TypedPolling 模式、2 个 FlatFile 模式和 2 个映射。

这是我使用 SFTP 适配器时收到的警告和错误

警告

The adapter failed to transmit message going to send port "SEND_FileFormat_BSFTP" with URL "SFTP://xxx.xxx.xxx.xxx:22/ToPartner/sftp/%SourceFileName%". It will be retransmitted after the retry interval specified for this Send Port. Details:"An unexpected failure occurred while processing a message. The text associated with the exception is "[SftpTransmitterEndpoint] Unable to transmit file . Inner Exception:

The %SourceFileName% macro can only be used with the http://schemas.microsoft.com/BizTalk/2006/sftp-properties namespace. . Changing any Send Port Transport properties might require the host to be restarted, as the connection pool might still have connections".".

错误

A message sent to adapter "SFTP" on send port "SEND_FileFormat_BSFTP" with URI "SFTP://xxx.xxx.xxx.xxx:22/ToPartner/sftp/%SourceFileName%" is suspended. Error details: System.ArgumentException: A property with the name 'http://schemas.microsoft.com/BizTalk/2003/file-properties#ReceivedFileName' is not present.

Server stack trace: at System.ServiceModel.Channels.MessageProperties.get_Item(String name)
at Microsoft.BizTalk.Adapter.Sftp.SftpOutputChannel.BuildFileName(Message message) at Microsoft.BizTalk.Adapter.Sftp.SftpOutputChannel.Send(Message message, TimeSpan timeOut) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndSend(IAsyncResult result)

Exception rethrown at [1]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at System.ServiceModel.Channels.IOutputChannel.EndSend(IAsyncResult result) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendCallback(IAsyncResult result) MessageId: {055A8864-AB06-4849-ADC3-A5CB93016106} InstanceID: {FF1E3802-89CD-466C-B68E-2CF4EC662DF4}

这是我使用 Blogical SFTP 适配器时遇到的错误

Method: Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessage Error: [SftpTransmitterEndpoint] Unable to transmit file . Inner Exception: The %SourceFileName% macro can only be used with the http://schemas.microsoft.com/BizTalk/2006/sftp-properties namespace. . Changing any Send Port Transport properties might require the host to be restarted, as the connection pool might still have connections

------------------------------ Information: Type: Blogical.Shared.Adapters.Sftp.SftpException Target: Microsoft.BizTalk.Message.Interop.IBaseMessage ProcessMessageInternal(Microsoft.BizTalk.Message.Interop.IBaseMessage, Blogical.Shared.Adapters.Sftp.ISftp) Message: [SftpTransmitterEndpoint] Unable to transmit file . Inner Exception: The %SourceFileName% macro can only be used with the http://schemas.microsoft.com/BizTalk/2006/sftp-properties namespace. . Changing any Send Port Transport properties might require the host to be restarted, as the connection pool might still have connections Stacktrace: at Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessageInternal(IBaseMessage message, ISftp sftp) at Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessage(IBaseMessage message)

------------------------------ Type: System.Exception Target: System.String ReplaceMacros(Microsoft.BizTalk.Message.Interop.IBaseMessage, System.String) Message: The %SourceFileName% macro can only be used with the http://schemas.microsoft.com/BizTalk/2006/sftp-properties namespace. Stacktrace: at Blogical.Shared.Adapters.Sftp.SftpTransmitProperties.ReplaceMacros(IBaseMessage message, String uri) at Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessageInternal(IBaseMessage message, ISftp sftp)

我试过:

这已通过完全重新部署管道程序集得到解决。 DLL 在发布时不同步。 GAC 版本与部署到 BizTalk 的版本不匹配。