title: The server rejected the session-establishment request: WCF hosted on IIS
body: <p>We have some WCF services implemented in an IIS application, communicating over net.tcp on the default port (808), using the Microsoft Net.Tcp Port Sharing Service, throwing an error on production servers. When I instantiate a connection to the first of the services, I get back an exception: </p>
  
  <blockquote>
    <p>The server at <code>&lt;URL&gt;</code> rejected the session-establishment request.  All the other services respond fine.</p>
  </blockquote>
  
  <p>But it runs fine on our test servers.</p>
  
  <p>I initially thought there was something wrong with the particular service that was failing, but I tried rearranging the list of services into a different order, and it SEEMS to always be the first service that I hit that fails. (I say SEEMS because it think once in the early iterations of testing, I saw it happen on the second service that it hit. But I haven't been able to reproduce that.)</p>
  
  <p>I've looked at application startup delays, and that doesn't seem to be the problem, because I can come back and run the test again as soon as it finishes - a delay of only a minute or two - and get the same error. Also, in the lower level environments, there is a start up delay of probably 30 seconds to a minute, but the result still comes back as expected.</p>
  
  <p>I've tried accessing the services over http from INetManager, and I get intermittent failures on all the services - a particular service will return a yellow screen of death on on invocation, then come up with the expected link to the WSDL on the next one seconds later.</p>
  
  <p>I'm completely at a loss to explain this behavior, or how to resolve it.  I've googled the error message, and not found anything helpful.  It may be a configuration issue - the production servers are newly provisioned VM's, and we may not have the config exactly right (whereas all the lower level environments have been running this and other similar apps for some time), but I have not idea what to look for.  I've looked at the properties of the app pool that the app is running on and compared it to the lower level environments without finding any differences.</p>
  
  <p>If somebody can point me in the right direction, you would have my undying gratitude.</p>