简体   繁体   中英

System.ServiceModel.ServerTooBusyException

I hosted my WCF Service using Windows Service, but when I call the WCF method I get the following error:

System.ServiceModel.ServerTooBusyException: The HTTP service located at http://localhost:8733/Design_Time_Addresses/RahatWcfServiceLibrary/ServerDateTime/ is too busy. ---> System.Net.WebException: The remote server returned an error: (503) Server Unavailable.

The App.Config in my WCF Service and Windows Service is as follows:

<?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>

我通过在使用该服务的Windows应用程序的App.Config文件的终结点地址的末尾添加“ / mex”解决了该问题。

<endpoint address="http://localhost:8733/Design_Time_Addresses/RahatWcfServiceLibrary/ServerDateTime/mex"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM