WCF FaultException: The server is not accepting new secure conversations currently because it is closing

46 Views Asked by At

I have a WCF service using wsHttpBinding and message security.

The clients occasionally receive an error that I wasn't able to reproduce myself.

System.ServiceModel.EndPointNotFoundException: Server 'http://ip:port/service_name' sent back a fault indicating it is in the process of shutting down. Please see the inner exception for fault details. ---> System.ServiceModel.FaultException: The server is not accepting new secure conversations currently because it is closing. Please retry later.

This happens on clients very first request to the WCF service. Other clients are connected to the service at the same time, which means that the server doesn't close or shut down as an error states. Is it related to number of active sessions?

Service configuration is as follows

<system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="wsHttpBindingAuth" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" />
      <security mode="Message">
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="mexBehaviour">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceCredentials>
        <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Services.CustomUserNameValidator, Service" />
        <serviceCertificate findValue="localhost" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" />
      </serviceCredentials>
    </behavior>
  </serviceBehaviors>
</behaviors>
  <services>
    <service name="Services.ServerService" behaviorConfiguration="mexBehaviour">
      <endpoint address="Service" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingAuth" contract="IServiceContractNS.IServiceContract" />
      <host>
        <baseAddresses>
          <add baseAddress="http://localhost:8080/" />
        </baseAddresses>
      </host>
    </service>
  </services>
</system.serviceModel>
0

There are 0 best solutions below