Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy would a WCF webservice hosted in IIS randomly stop responding?
    text
    copied!<p>This is my first attempt to use WCF so there may be something fundamentally wrong with this approach - if so I'm happy to switch to a different model. At quick glance, I thought the answer to <a href="https://stackoverflow.com/questions/739312/c-wcf-wcf-stops-responding-after-about-10-or-so-calls-throttling">this question</a> would have worked, but my scenario appears to be different.</p> <p>I have an ASP.NET MVC website where the controllers access the WCF client class through an intermediate repository. The repository is just a wrapper around the WCF client that instantiates it once and sets the proper endpoint address.</p> <pre><code>public class WcfRepository : IRepository { private MyWCFServiceClient client; public WcfRepository() { client = new MyWCFServiceClient(); } public bool MyMethod1() { return client.MyMethod1(); } ... etc } </code></pre> <p>I can access different pages on the website until a seemingly random point where the WCF service will start timing out. It doesn't matter which method I call either - it timesout on different ones. I cannot see any exceptions on the IIS machine hosting the WCF service either; the event log there is empty. A simple method like <code>GetCustomerByName()</code> which worked two minutes earlier will no longer so I think it's more to do with WCF communication rather than the service itself.</p> <p>If I try to use the WCF Test Client after one of these timeouts occurs, it will also fail. But, if I wait a while (and choose 'start a new proxy') then things will work again.</p> <p>I'm very confused - should I be creating a new instance of the WCF client each time I want to use it in my repository? Is there another way I should be using the client? Wrapping each call in <code>Open()/Close()</code> doesn't work either since the first call to <code>Close()</code> puts the object in a disposed state.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload