WCF 中的服务器错误 [英] Server error in WCF

查看:26
本文介绍了WCF 中的服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:

这个集合已经包含一个带有 http 方案的地址.那里在此集合中,每个方案最多可以有一个地址.如果你的服务托管在 IIS 中,您可以通过设置来解决问题'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'真实或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.参数名称:item 描述:发生未处理的异常在执行当前 Web 请求期间.请查看堆栈跟踪以获取有关错误及其位置的更多信息起源于代码.

Server Error in '/cms' Application.

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

异常详情:

System.ArgumentException: This collection already contains an address with scheme http.  There can be at most one address per scheme

在这个集合中.如果您的服务托管在 IIS 中,您可以修复通过设置问题'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'真实或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.参数名称:item

in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item

源错误:

在执行过程中产生了一个未处理的异常当前网络请求.有关来源和位置的信息可以使用下面的异常堆栈跟踪来识别异常.

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆栈跟踪:

[ArgumentException: This collection already contains an address with scheme http.  There can be at most one address per scheme in this

收藏.如果您的服务托管在 IIS 中,您可以修复设置问题'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'真实或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.参数名称:项目]System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) +16395359System.Collections.Generic.SynchronizedCollection`1.Add(T item) +79System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] 地址) +222System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +346System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(类型serviceType, Uri[] baseAddresses) +43System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(字符串构造函数字符串,Uri[] baseAddresses) +530System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50System.ServiceModel.HostingManager.EnsureServiceAvailable(字符串normalizedVirtualPath) +1172

collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item] System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) +16395359 System.Collections.Generic.SynchronizedCollection`1.Add(T item) +79 System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) +222 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +346 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +43 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +530 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172

[ServiceActivationException: The service '/cms/service.svc' cannot be activated due to an exception during compilation.  The exception

消息是:这个集合已经包含一个带有scheme的地址http.在此集合中,每个方案最多可以有一个地址.如果您的服务托管在 IIS 中,您可以通过以下方式解决问题环境'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'真实或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.参数名称:项目.]System.Runtime.AsyncResult.End(IAsyncResult 结果) +901424System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult结果)+178702System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResultar) +107

message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item.] System.Runtime.AsyncResult.End(IAsyncResult result) +901424 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178702 System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107

-------------------------------------------------------------------------------- 版本信息:Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.0.30319.237

-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

我做错了什么?

推荐答案

在您的 web.config 文件中是否存在具有多个端点的服务?如果单个服务(在部分)有多个端点,则只有一个端点可以没有地址属性集.其他端点需要有地址设置.

Is there a service with multiple endpoints in your web.config file? If there are multiple endpoints for a single service (In section), then only one endpoint can have no address attribute set. The other endpoints need to have the address setting.

从客户端来看,如果要使用带有新端点地址的端点,则需要将其包含在地址中,例如http://localhost/cms/Service.svc/newEP"

From the client side, if you want to use the endpoint with the new endpoint address, you need to include it in the address, such as "http://localhost/cms/Service.svc/newEP"

http://msdn.microsoft.com/en-us/library/ms731320.aspx

http://msdn.microsoft.com/en-us/library/aa751841.aspx

这篇关于WCF 中的服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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