Intermittent Communication Problems between the Silverlight Client and WCF

I have a Silverlight 4 application that communicates with a server running IIS 7.5, which hosts several of my own WCF services. The application works happily in 99% of cases, but users report that the application freezes several times a day or error messages will be generated at different points in the application.

I turned on WCF tracing and the following errors occurred:

<Exception>
  <ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
  <Message>The number of bytes available is inconsistent with the HTTP Content-Length header.  There may have been a network error or the client may be sending invalid requests.        </Message>
  <StackTrace>
    at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
    at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception&amp; requestException)
    at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, Action callback)
    at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
    at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
    at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
    at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
  </StackTrace>
</Exception>

Then I ran Fiddler on the user's machine and found the following errors:

HTTP/1.1 504 Fiddler - Receive Failure
Content-Type: text/html; charset=UTF-8
Connection: close
Timestamp: 18:24:21.941

ReadResponse() failed: The server did not return a response for this request.

Some studies seem to have some communication problem between the client and server. The server is a virtual private server with which I have never had problems, and from viewing the logs it never exceeded the processor / memory.

: 1. -, , , -, IIS , , 2. Silverlight , (, 30 ), ,

+5

All Articles