Silverlight客户端和WCF服务之间的间歇性通信问题

我有一个Silverlight 4应用程序,它与运行IIS 7.5的服务器通信,该服务器承载了许多我自己的WCF服务.应用程序99%的时间运行愉快,但用户报告应用程序每天会冻结几次,或者在应用程序的各个点生成错误消息.

我打开了WCF跟踪,发生以下错误

<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,NativeOverlapped* pOVERLAP)
  </StackTrace>
</Exception>

然后我在用户的机器上运行fiddler,发现发生了以下错误

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.

从一些研究来看,客户端和服务器之间存在一些通信问题.服务器是一个虚拟专用服务器,我从来没有遇到任何麻烦,从查看日志它永远不会超出处理器/内存.

我的问题是:
1.我可以做些什么来更详细地跟踪发生的事情或我可以调整的任何IIS或服务器相关的内容以避免此错误
2.在我的Silverlight应用程序中有一些方法可以等待特定的时间(例如30秒),如果没有收到响应,请取消当前请求并再试一次

解决方法

相关文章

如何在Silverlight4(XAML)中绑定IsEnabled属性?我试过简单的...
我正在编写我的第一个vb.net应用程序(但我也会在这里标记c#,...
ProcessFile()是在UIThread上运行还是在单独的线程上运行.如...
我从同行那里听说,对sharepoint的了解对职业生涯有益.我们不...
我正在尝试保存一个类我的类对象的集合.我收到一个错误说明:...
我需要根据Silverlight中的某些配置值设置给定控件的Style.我...