System.ServiceModel.ServerTooBusyException

本文关键字:ServerTooBusyException ServiceModel System | 更新日期: 2023-09-27 18:30:52

我使用 Windows 服务承载了我的 WCF 服务,但是当我调用 WCF 方法时,我收到以下错误:

System.ServiceModel.ServerTooBusyException:HTTP 服务位于 在 http://localhost:8733/Design_Time_Addresses/RahatWcfServiceLibrary/ServerDateTime/ 太忙了。 ---> System.Net.WebException:返回的远程服务器 错误: (503) 服务器不可用。

我的 WCF 服务和 Windows 服务中的 App.Config 如下所示:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="RahatWcfServiceLibrary.ServerDateTimeBehavior" name="RahatWcfServiceLibrary.ServerDateTime">
        <endpoint address="" binding="wsHttpBinding" contract="RahatWcfServiceLibrary.IServerDateTime">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/Design_Time_Addresses/RahatWcfServiceLibrary/ServerDateTime/mex" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="RahatWcfServiceLibrary.ServerDateTimeBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling maxConcurrentCalls="60" maxConcurrentSessions="60"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

System.ServiceModel.ServerTooBusyException

我通过在使用该服务的 Windows 应用程序中的 App.Config 文件中的端点地址末尾添加"/mex"来解决此问题。

<endpoint address="http://localhost:8733/Design_Time_Addresses/RahatWcfServiceLibrary/ServerDateTime/mex"
相关文章:
  • 没有找到相关文章