WCF timeout after 60 secs - tried everything RRS feed

  • Question

  • Running into an issue using .Net 3.5 SP1 and WCF with regards to timeouts with an application we are working on. Some of the requests we send out are longer lived than 1 minute on the server - i.e. processing takes that long. Server takes the request from the client, turns around and does some query/process itself and returns. These activities will finish eventually, or hit a much larger timeout we would like to apply.


    However we receive CommunicationException “The underlying connection was closed” consistently at the 60 sec mark even though all WCF timeouts in both proxy and server config are set to values around or over 5 minutes (eg. opentimeout, closetimeout, sendtimeout, receivetimeout). Have tried things like changing httpruntime sessiontimeout in machine config, execution timeout in asp.net, keepalive=false but none of it helped. Server continues the execution while client receives this exception. Server execution doesnt get disrupted which makes me think this is a client side timeout.

     Can you please help or point me in the right direction. Spent a lot of time on this and tried everything I found on the net but reached a dead end.

    Below is the exception:


    *.vshost.exe Error: 0 : 3/3/2010 11:30:06 PM-11:*.cs:20 There was a communication problem. System.ServiceModel.CommunicationException: The underlying connection was closed: The connection was closed unexpectedly. ---> System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
       at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       --- End of inner exception stack trace ---
    Server stack trace:
       at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Thursday, March 4, 2010 10:07 PM