【问题标题】:Service Unavailable 503 + The HTTP service located at http://localhost/ProductsService/Service.svc is too busyService Unavailable 503 + 位于 http://localhost/ProductsService/Service.svc 的 HTTP 服务太忙
【发布时间】:2011-06-15 03:51:00
【问题描述】:

您好,我一直在尝试解决我的问题,但对此无能为力。

问题是

http://localhost/productservice/service.svc 在浏览器中输入此地址时,出现 503 Service Unavailable 错误

当我从 VS 2010 运行我的代码时,它给了我

位于http://localhost/ProductsService/Service.svc 的HTTP 服务太忙。 例外。

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>

任何帮助将不胜感激 谢谢

【问题讨论】:

  • 你需要给我们更多才能继续!你的配置是什么?你用什么绑定?向我们展示服务器端配置!! ( 标签内的任何内容)
  • 我已经添加了配置谢谢
  • 您的配置看起来正确。您是否尝试调试您的服务?顺便提一句。 Windows 7 Home 有 IIS7?
  • 我做了微软服务跟踪查看器!我可以看到 System.ServiceModel.ServerTooBusyException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 是的 Windows 7 Home 有 IIS 7.5 你认为我在这里遗漏了什么吗?出现该异常后,应用程序池停止工作,我必须重新启动它。
  • 我无法让它工作,无论我尝试什么都没有帮助!我必须完全卸载并安装 ISS 7.5、.Net V4.0 框架。现在它工作正常。我猜这是 .Net 4 与 IIS 7.5 的兼容性问题,感谢您的帮助 :) 干杯!

标签: iis-7 wcf wcf-client http-status-code-503


【解决方案1】:

我们的团队遇到了同样的问题,503 Service Unavailable。 在我们的例子中,应用程序池很好,(身份设置正确并且应用程序池已启动)。

经过一些评估,我们发现在保留端口 80 的服务器上安装了一个基于 WCF 的服务。使用 netsh http 命令我们能够看到 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

【讨论】:

【解决方案2】:

我在 IIS 7 中不断收到 503 错误,在 localhost 上运行 .NET 4.0 网站。我对此感到相当自鸣得意,因为我所要做的就是单击左侧窗格中的应用程序池,您会在其中看到列出的站点和应用程序池。果然,相关的应用程序池总是停止,我只是重新启动它。然而,今天(我回到这个问题的原因)这并没有解决问题。就我而言,我有一个包含一些公共页面的网站,然后是 2 个受密码保护的应用程序。只有一个应用程序给出了 503 错误。我选择了应用程序并单击了高级设置,然后意识到问题出在应用程序池上。它指向 DefaultAppPool 而不是整个网站的应用程序池。当我更正这一点时,网站的所有 3 个区域都重新开始正常工作。所以,综上所述,503错误可能是由停止的应用程序池引起的。只需确保重新启动正确的应用程序池以使您的网站再次运行。

【讨论】:

    【解决方案3】:

    有同样的问题,但原因不同。在 IIS(左侧面板)中,单击应用程序池并确保您选择的 ASP.NET 版本正在实际运行。我的因为某种原因关闭了。

    【讨论】:

    • 我的应用程序池已关闭,因为我们的 COTS CRM 系统认为将其关闭是个好主意。
    【解决方案4】:

    我也遇到了同样的问题,解决办法是,

    在 IIS 中单击默认网站下的 ProductsService 网站。在操作窗格下的右侧,单击高级设置。检查 Enabled Protocol 属性,该属性的值应以逗号分隔,例如: http,net.tcp 。实际上,我输入了分号而不是逗号,并且我曾经遇到过您所面临的相同异常。尝试替换分号哪个逗号。我认为它应该有效。

    【讨论】:

      【解决方案5】:

      我也有同样的问题。对我来说,问题原来是密码无效。我的密码最近更改了,IIS 的应用程序池使用旧密码。密码更新后,应用程序再次运行。

      希望有所帮助。

      【讨论】:

      • 谢谢南!看起来运行 hte 应用程序池和站点的帐户的密码已更改。重置并停止/启动,并且在 VS 中构建或打包时没有错误。
      猜你喜欢
      • 2012-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-07
      • 2017-08-02
      • 2014-12-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多