I have a WCF Service and an application with a Service Reference to it, and with the application I have a loop and in each iteration it\'s making a call to a method in this
After pulling my hairs over a much similar problem that was not solved by either Close()
or Dispose()
I would like to add a simple solution that made my day, namely by increasing the ServicePointManager.DefaultConnectionLimit which is by default 2.
"The DefaultConnectionLimit property sets the default maximum number of concurrent connections that the ServicePointManager object assigns to the ConnectionLimit property when creating ServicePoint objects."
In my case my application successfully connected to my remote service 2 times, on the third attempt it simply did not try to connect to the service. Instead it waited for a while before timing out with the same error message as in the question above. Increasing DefaultConnectionLimit
resolved this. To add to the frustration this behavior was somewhat random - in one case of 10 the webservice was invoked successfully multiple (>2) times.
The solution originates and are further discussed these two threads: wcf-timeout-exception-detailed-investigation and wcf-service-throttling. solved my issue.