0

我正在尝试使用 BizTalk 2013 中的 WCF-SQL 适配器从存储过程返回记录。我遵循了一个简单的在线演练,似乎得到了我需要的东西。但是,当接收位置运行时,我不断收到转换错误。我的 SP 中没有任何 GUID。我什至将我的 SP 简化为返回硬编码字符串的 SQL 语句。

SELECT [Description] , PackageName FROM ( SELECT 'ABC' [Description] ,'123' as PackageName ) 作为 ResponseTable

Schema 需要两个字符串类型的字段。

请参阅下面的错误。

The receive location "Receive - Package" with URL "mssql://xxx/xxx?InboundId=PackageErrors" is shutting down. Details:"Microsoft.ServiceModel.Channels.Common.AdapterException: Unable to cast object of type 'System.Guid' to type 'System.IConvertible'.. Endpoint Address - mssql://xxx/xxx?InboundId=PackageErrors ---> <b>System.InvalidCastException: Unable to cast object of type 'System.Guid' to type 'System.IConvertible'.</b>
at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.Polling_WaitForMessage(TimeoutHelper timeoutHelper)
at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.WaitForMessage(TimeSpan timeout)
--- End of inner exception stack trace ---
at Microsoft.Adapters.Sql.SqlAdapterInboundHandler.WaitForMessage(TimeSpan timeout)
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterInputChannel.WaitForMessage(TimeSpan timeout)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.WaitForMessage()".
4

1 回答 1

0

这种走过去在一方面是错误的。

与其使用“添加适配器元数据”,不如使用“使用适配器服务”,选择 sqlBinding,配置 URI,连接,为合同类型选择服务(入站操作),然后从那里选择您的存储过程。

这将具有为您的接收位置创建绑定文件的额外好处,然后您可以导入并正确配置该文件。它不会像添加适配器元数据那样创建编排,但我实际上更喜欢这样。

于 2014-04-10T20:57:48.440 回答