加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 尝试添加silverlight服务时出现“无法导入wsdl:binding”

发布时间:2020-12-15 21:31:03 所属栏目:百科 来源:网络整理
导读:我在尝试向Silverlight 4添加新的Web服务时收到此错误.我已在数据访问对象层中打开客户端并具有调用服务的业务逻辑.显示的错误输出与 Windows批处理文件运行有关,该运行应该生成调用新Web服务所需的文件.我已经到处寻找解决方案,我已经尝试将服务引用类型更
我在尝试向Silverlight 4添加新的Web服务时收到此错误.我已在数据访问对象层中打开客户端并具有调用服务的业务逻辑.显示的错误输出与 Windows批处理文件运行有关,该运行应该生成调用新Web服务所需的文件.我已经到处寻找解决方案,我已经尝试将服务引用类型更改为通用列表,并根据另一个解决方案的指示取消选中“在通用程序集中重用类型”(通过右键单击解决方案资源管理器中的服务引用实例来定位复选框)在VS 2010中选择服务参考设置.)
错误:无法导入wsdl:binding和错误:无法导入wsdl:porttype继续显示.
任何输入都会非常感激.

Attempting to download metadata from ‘http://localhost:64903/Services/ServiceWcfS.svc’ using WS-Metadata Exchange or DISCO.

Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension:
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: ISerializable type with data contract name ‘PropertyChangedEventHandler’ in namespace ‘http://schemas.datacontract.org/2004/07/System.ComponentModel’ cannot be imported. The data contract namespace cannot be customized for ISerializable types and the generated namespace ‘AccessPoint.WcfServices.ServiceWcfS’ does not match the required CLR namespace ‘System.ComponentModel’. Check if the required namespace has been mapped to a different data contract namespace and consider mapping it explicitly using the namespaces collection.
XPath to Error Source: //wsdl:definitions[@targetNamespace=’http://tempuri.org’]/wsdl:portType[@name=’IServiceWcfS’]

Error: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:portType[@name='IServiceWcfS']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:binding[@name='BasicHttpBinding_IServiceWcfS']

Error: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:binding[@name='BasicHttpBinding_IServiceWcfS']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org']/wsdl:service[@name='ServiceWcfS']/wsdl:port[@name='BasicHttpBinding_IServiceWcfS']

Error: No endpoints compatible with Silverlight 4 were found. The generated client class will not be
usable unless endpoint information is provided via the constructor.

解决方法

我知道有点晚了,但我认为你的错误就在这里:

System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: ISerializable type with data contract name 'PropertyChangedEventHandler' in namespace...

PropertyChangedEventHandler是委托类型,因此不可序列化,查找正在使用它的内容(数据协定或服务方法)并将其删除.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读