Search code examples
wcfnettcpbindingbasichttpbinding

Intermittent WCF Connection (There was no endpoint .. ) error


I have a WCF service hosted in the IIS (IIS 8). The service is in a Per Call Mode and the concurrency mode is set to Multiple. I have around 600 clients connecting to it. It has a HTTPS end point. It also has a net.tcp endpoint but that is not used. Not all but some of my clients face a very weird problem. The client stops working after using for a while. I have error logging and at the client side I see the error which says

There was no end point listening at ...

There are no errors on the server, or the service. The service seems to be working fine. I can browse to the service page from a browser and other clients are still able to use the service. Running a trace is also not helping. I have spent enough time trying to figure it out but with no luck. Further more, on the same computer just restarting the client seems to work and connect to the same service. The client is a WinForms Application. I performed a DNS flush on my machine and even that does not help.

What could be the possible issue? The things that hit my mind are that maybe the client is unable to resolve the name, but that is contradictory to it connecting in the first place. The service maybe down, but my other clients are still using the same and they do not face problems. It might be a problem with the client machine as it Uses Win XP but I am not sure if that would cause a problem. Or it might be a problem because of intermittent internet connection.

Has anyone ever faced such a problem before? Some insight would be really helpful


Solution

  • IIS can only serve a limited number of clients at a time. It will then place additional requests onto a queue. That queue is also limited. When that queue fills up then IIS returns a 500 error, which is interpreted as "There was no end point listening at ..."

    You should try this piece of code.

    public void Main()
    {
        while(thereIsStillThisProblem)
        {
            var pc = new Pc();
            pc.OS = new Windows2012();
            pc.Start();
            pc.Software.Add(new ServiceHost());
        }
    }
    

    http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/iis/64e30660-d2f0-4e90-98cc-1652214a2b93.mspx

    Edit: Just remembered that there is one more thing you can do, if you are using .net 4.5. I will let Jon Skeet explain.