无法将类型为"System.Guid"的对象转换为类型为"System.IConvertible"的对象 [英] Unable to cast object of type 'System.Guid' to type 'System.IConvertible'

查看:80
本文介绍了无法将类型为"System.Guid"的对象转换为类型为"System.IConvertible"的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to use the WCF-SQL adaptor in BizTalk 2013 to return records from a stored procedure. I followed a simple online walkthrough that seemed to get me what I need. However I keep getting a casting error when the Receive Location runs. I dont have any GUID's in my SP. I have even simplified my SP to a SQL statement returning hard coded strings.

选择[说明],PackageName FROM(选择"ABC" [说明],"123"作为PackageName)作为ResponseTable

该模式需要两个字符串类型的字段.

the Schema expects two fields of type string.

请参见下面的错误.

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()".

推荐答案

这一过程在一方面是错误的.

That walk through is wrong in one aspect.

最好使用"Consume Adapter Service",而不是使用"Add Adapter Metadata",选择sqlBinding,配置URI,Connect,为合同类型选择Service(入站操作),然后选择存储过程从那里.

Rather than using the "Add Adapter Metadata" you would be better of using the "Consume Adapter Service", select the sqlBinding, Configure the URI, Connect, select Service (Inbound operations) for the contract type and select your stored procedure from there.

这将为您的接收位置创建绑定文件带来更多好处,您可以随后将其导入并进行正确配置.它不像添加适配器元数据那样创建业务流程,但我实际上更喜欢.

This will have the added benefits creating a binding file for your receive location, which you can then import and will be correctly configured. It doesn't create an Orchestration like the Add Adapter Metadata, but I actually prefer that.

这篇关于无法将类型为"System.Guid"的对象转换为类型为"System.IConvertible"的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆