2011-01-25 50 views
11

嗨,我一直在試圖解決我的問題,但無能爲力。服務不可用503 +位於http://localhost/ProductsService/Service.svc的HTTP服務太忙

問題是

http://localhost/productservice/service.svc型這個地址在我的瀏覽器時,它給了我503服務不可用錯誤

當我從2010 VS我的代碼運行它給我

HTTP服務位於http://localhost/ProductsService/Service.svc太忙了。 異常。

ProductService使用ApplicationPoolIdentity在ASP.NET v4.0集成應用程序池中運行。

我只是不知道我需要做什麼!

(Windows 7家庭& IIS7)

basicHttpBinding的使用

服務器端的配置是

<?xml version="1.0"?> 
<configuration> 
    <connectionStrings> 
     <add name="AdventureWorksEntities" connectionString="metadata=res://*/ProductsModel.csdl|res://*/ProductsModel.ssdl|res://*/ProductsModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=PINCHY\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/> 
    </connectionStrings> 
    <system.web> 
     <compilation debug="true" targetFramework="4.0"> 
      <assemblies> 
       <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
      </assemblies> 
     </compilation> 
    </system.web> 
    <system.serviceModel> 
     <behaviors> 
      <serviceBehaviors> 
       <behavior> 
        <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
        <serviceMetadata httpGetEnabled="true"/> 
        <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
        <serviceDebug includeExceptionDetailInFaults="false"/> 
       </behavior> 
      </serviceBehaviors> 
     </behaviors> 
     <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/> 
    </system.serviceModel> 
    <system.webServer> 
     <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
</configuration> 

客戶端的app.config是

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 
     <bindings> 
      <basicHttpBinding> 
       <binding name="BasicHttpBinding_IProductsService" closeTimeout="00:01:00" 
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
        maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
        useDefaultWebProxy="true"> 
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
         maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
        <security mode="None"> 
         <transport clientCredentialType="None" proxyCredentialType="None" 
          realm="" /> 
         <message clientCredentialType="UserName" algorithmSuite="Default" /> 
        </security> 
       </binding> 
      </basicHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="http://localhost:80/ProductsService/Service.svc" 
       binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProductsService" 
       contract="ProductsService.IProductsService" name="BasicHttpBinding_IProductsService" /> 
     </client> 
    </system.serviceModel> 
</configuration> 

任何幫助將非常感謝 Tha nks

+2

你需要給我們更多的去!你的配置是什麼?你使用什麼綁定?向我們展示服務器端配置! (標記內的任何內容) – 2011-01-25 12:03:57

+0

我已添加配置感謝 – Pinchy 2011-01-25 12:47:03

+0

您的配置看起來正確。您是否嘗試調試您的服務?順便說一句。 Windows 7家庭有IIS7? – 2011-01-26 21:40:15

回答

19

有同樣的問題,但不同的原因。在IIS(左側面板)中,單擊應用程序池並確保您選擇的ASP.NET版本實際上正在運行。我因爲某種原因關閉了。

8

我只是有同樣的問題。我發現的問題是一個無效的密碼。我的密碼最近更改了,IIS的應用程序池使用舊密碼。密碼更新後,應用程序再次運行。

希望有所幫助。

2

我也遇到了同樣的問題,解決的辦法是,

在默認下的網站上ProductsService網站IIS點擊。在操作窗格的右側點擊高級設置。選中Enabled Protocol屬性,該屬性的值應該用逗號分隔,例如:http,net.tcp。其實我已經輸入了分號而不是逗號,而且我曾經得到了你面臨的同樣的異常。嘗試用逗號替換分號。我認爲它應該工作。

1

我在本地主機上運行.NET 4.0網站的IIS 7中不斷收到503錯誤。我對此很滿意,因爲我只需點擊左側窗格中的應用程序池,在其中列出了站點和應用程序池。果然,相關的應用程序池總是停下來,我剛剛重新啓動它。但是,今天(我回到這個問題的原因),這並沒有解決問題。在我的情況下,我有一個網站有一些公共頁面,然後是2個密碼保護的應用程序。只有一個應用程序發出503錯誤。我選擇了應用程序並單擊高級設置,並意識到問題在於應用程序池。它指向DefaultAppPool而不是整個網站的應用程序池。當我糾正錯誤時,網站的所有3個區域都開始正常工作。總而言之,一個503錯誤可能是由一個停止的應用程序池引起的。只要確保您重新啓動正確的應用程序池以使您的網站再次運行。

1

我們的團隊遇到同樣的問題,503 Service Unavailable。 在我們的例子中,應用程序池很好,(身份設置正確,應用程序池已啓動)。

經過一番評估,我們發現基於WCF的服務安裝在保留端口80的服務器上。使用netshhttp命令,我們能夠看到url保留。

netsh http show urlacl 

Reserved URL   : http://+:80/ 

以下鏈接證明有用: http://blogs.msdn.com/b/webtopics/archive/2010/02/17/a-not-so-common-root-cause-for-503-service-unavailable.aspx