WCF项目 [英] wcf project
问题描述
运行wcf项目时出现此错误:
System.InvalidOperationException:不可能解决网络基础知识和地址更改问题,并且无法最终确定NetTcpBinding的终止点. Lesschémasd’adresse de base会注明[http].
àSystem.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri,绑定绑定,UriSchemeKeyedCollection baseAddresses)
àSystem.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase主机,ServiceDescription描述,ServiceElement serviceElement,Action`1 addBaseAddress)
àSystem.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader,ServiceDescription描述,ServiceElement serviceSection)
àSystem.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader,ServiceDescription描述,字符串configurationName)
àSystem.ServiceModel.ServiceHostBase.ApplyConfiguration()
àSystem.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
àSystem.ServiceModel.ServiceHost.InitializeDescription(类型serviceType,UriSchemeKeyedCollection baseAddresses)
àSystem.ServiceModel.ServiceHost..ctor(类型serviceType,Uri [] baseAddresses)
àMicrosoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type,ServiceKind kind)
àMicrosoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo信息)
如果有任何解决方案,请帮助我
Hi,
I have got this error when i run my wcf project:
System.InvalidOperationException: Impossible de trouver une adresse de base qui correspond au schéma net.tcp pour le point de terminaison avec la liaison NetTcpBinding. Les schémas d’adresse de base inscrits sont [http].
à System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
à System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress)
à System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
à System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName)
à System.ServiceModel.ServiceHostBase.ApplyConfiguration()
à System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
à System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)
à System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
à Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type, ServiceKind kind)
à Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)
If any one have solution please help me
推荐答案
如果您尚未这样做,建议从 ^ ],然后使用它来研究您所包含的堆栈跟踪中引用的某些类.
(粗略地)翻译法文,例外是说系统找不到与net.tcp模式相对应的基址.最后,说明所包含的(可用的?有效的?)模式基址是http.
您需要研究ServiceInfo,ServiceHostHelper和ServiceHostBase对象的文档以了解基地址"的含义.这将是理解异常的关键.
猜测中,WCF服务器仅通过HTTP协议公开服务,而您的客户端要求基于TCP的服务.但这是一个很大的猜测,因为我从未使用过WCF!
If you haven''t already done so, I recommend downloading ".Net Reflector" from www.redgate.com/products/reflector/index.htm[^], and then using it to study some of the classes that are referenced in the stack trace you included.
(Roughly) translating the French, the exception is saying that the system couldn''t find a base address that corresponds to the net.tcp schema; it finishes by saying that the included (available? valid?) schema base addresses are http.
You need to study the ServiceInfo, ServiceHostHelper and ServiceHostBase objects'' documentation to understand what is meant by ''base address.'' This will be the key to understanding the exception.
At a guess, the WCF server is only exposing services via the HTTP protocol and your client is asking for TCP-based services. But that''s a big guess since I''ve never used WCF!
这是一个配置错误.您的客户端使用的终结点与为该服务本身实现的任何终结点都不兼容.
It''s a configuration error. The endpoint your client is using isn''t compatible with any endpoints implemented for the service itself.
当我将终结点的配置从NetTcpBindind更改为wsHttpBinding时,我的项目工作不会出现任何问题
when i change the configuration of endpoint from NetTcpBindind to wsHttpBinding my project work without any problem
这篇关于WCF项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!