2011-07-09 107 views
0

我在.Net 4.0上有一個WCF Rest服務,使用本地IIS 7.5時此服務運行良好。但我有一個網站託管軟件包,當我發佈服務給他們收到應用程序錯誤並沒有詳細說明錯誤類型。以前我已經在.Net 4.0上發佈過其他類型的WCF服務,這是可以的。部署該服務的公司是Arvixe,我已聯繫他們的支持人員,他們告訴我要將該處理程序添加到我的web.config中。但是這不再工作。WCF Rest部署

這是我的web.config文件

<validation validateIntegratedModeConfiguration="false"/> 

<modules runAllManagedModulesForAllRequests="true"> 
    <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
</modules> 

<handlers> 
    <!-- Make sure we can use this handler for any URL because we're using ReST. The default is 
     for it to be used only for .svc --> 
    <remove name="svc-Integrated-4.0" /> 
    <add name="svc-Integrated-4.0" path="*" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" /> 

    <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 

</handlers> 

這是我的跟蹤日誌時,我呼籲我的WCF服務的操作!

System.ServiceModel錯誤:131075:http://msdn.microsoft.com/zh-CN/library/System.ServiceModel.Diagnostics.ThrowingException.aspx拋出異常./LM/W3SVC/703/ROOT-3- 129547865876462000System.ArgumentException,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089此集合已經包含一個帶有方案http的地址。此集合中每個方案最多可以有一個地址。如果您的服務在IIS中託管,您可以通過將'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'設置爲true或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'來解決此問題。 參數名稱:在System.Collections.Generic.SynchronizedCollection 1.Add(T item) at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) at System.ServiceModel.Activation.WebServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state) at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state) at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) </StackTrace><ExceptionString>System.ArgumentException: 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</ExceptionString></Exception></TraceRecord> System.ServiceModel Error: 131074 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.EventLog.aspx</TraceIdentifier><Description>Wrote to the EventLog.</Description><AppDomain>/LM/W3SVC/703/ROOT-3-129547865876462000</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><CategoryID.Name>WebHost</CategoryID.Name><CategoryID.Value>5</CategoryID.Value><InstanceID.Name>WebHostFailedToProcessRequest</InstanceID.Name><InstanceID.Value>3221356547</InstanceID.Value><Value0>System.ServiceModel.ServiceHostingEnvironment+HostingManager/50346327</Value0><Value1>System.ServiceModel.ServiceActivationException: The service '/ForgetTrafficService.svc' cannot be activated due to an exception during compilation. The exception 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. ---&amp;gt; System.ArgumentException: 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 at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) at System.Collections.Generic.SynchronizedCollection 1.增加(T項) 在System.ServiceModel.UriSchemeKeyedCollection..ctor(URI [在System.ServiceModel.UriSchemeKeyedCollection.InsertItem(的Int32索引,烏里項) 項]類型 at System.ServiceModel.ServiceHost..ctor(Type serviceType,Uri [] baseAddresses) at System.ServiceModel.Activation.WebServiceHostFactory.CreateServiceHost(Type serviceType,Uri [] baseAddresses) at System.ServiceModel.Activation。 ServiceHostFactory.CreateServiceHost(String constructorString,Uri [] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.Hostin在System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)處結束內部異常堆棧跟蹤--- 。 at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) System.ServiceModel Error:131074:http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.EventLog.aspx寫入EventLog。 /LM/W3SVC/703/ROOT-3-129547865876462000WebHost5WebHostFailedToProcessRequest3221356547System.ServiceModel.Activation.HostedHttpRequestAsyncResult/37535352System.ServiceModel.ServiceActivationException:無法激活服務'/ForgetTrafficService.svc'由於編譯期間的異常。異常消息是:此集合已經包含一個地址與方案http。此集合中每個方案最多可以有一個地址。如果您的服務在IIS中託管,您可以通過將'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'設置爲true或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'來解決此問題。 參數名稱:item。 --- & gt; System.ArgumentException:此集合已經包含一個地址與方案http。此集合中每個方案最多可以有一個地址。如果您的服務在IIS中託管,您可以通過將'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'設置爲true或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'來解決此問題。 參數名稱:項目 在System.ServiceModel.UriSchemeKeyedCollection.InsertItem(的Int32索引,烏里項) 在System.Collections.Generic.SynchronizedCollection`1.Add(T項) 在System.ServiceModel.UriSchemeKeyedCollection..ctor(URI (類型serviceType,Uri [] baseAddresses) at System.ServiceModel.Activation .ServiceHostFactory.CreateServiceHost(String constructorString,Uri [] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.Hos tingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) --- End of internal exception stack trace --- at System.Runtime.AsyncResult.End [TAsyncResult](IAsyncResult result(IAsyncResult result) ) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)

+0

好吧我解決這個問題,我不知道爲什麼,但是當我刪除標記我的服務開始工作! – mastervv

回答

1

如果不知道你遇到了什麼錯誤,那麼建議你真的很難。我已經啓用WCF跟蹤來進一步解決這個問題, http://msdn.microsoft.com/en-us/library/ms733025.aspx

+1

你可以看看我的日誌跟蹤!他的收藏已經包含一個地址與方案http。此集合中每個方案最多可以有一個地址。如果您的服務在IIS中託管,您可以通過將'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'設置爲true或指定'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'來解決此問題。我不知道,這意味着! – mastervv

+0

我試着在web配置上添加attr ! – mastervv