我正在使用Microsoft服務跟蹤查看器檢查日誌以查找異常。例外是:需要幫助瞭解Microsoft服務跟蹤查看器日誌
An error occurred while receiving the HTTP response to ...someservice.svc.
This could be due to the service endpoint binding not using the HTTP protocol.
This could also be due to an HTTP request context being aborted by the server
(possibly due to the service shutting down). See server logs for more details.
該web服務已啓動並運行,我可以達到它的罰款。我使用來自同一web服務的方法生成了幾個報告,除了一個以外,一切都很好。 (這份報告有很多數據)。我猜它與返回太多的數據/超時有關,但我如何使用Microsoft Service Trace Viewer來檢查這個問題? (我是這個工具的新手)。
這是我的異常字符串:
<ExceptionString>System.ServiceModel.CommunicationException: An error occurred
while receiving the HTTP response to http://someservice.svc. This could be due
to the service endpoint binding not using the HTTP protocol. This could also
be due to an HTTP request context being aborted by the server (possibly due to
the service shutting down). See server logs for more details. --->
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a receive. --->
System.IO.IOException: Unable to read data from the transport connection: An
existing connection was forcibly closed by the remote host. --->
System.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---</ExceptionString>
請幫幫忙,我真的來到這裏不知道......
感謝您的回答。 我剛剛拿到了很多更多數據的som dbtables,並設法重現崩潰。這似乎與MaxReceivedMessageSize有關,但是從日誌中我不確定如何驗證這一點。我已經使用配置擴展了日誌記錄。從我的app.config中「如何打開wcf跟蹤」,但我仍然看不到日誌中的任何消息,說我已經超過了MaxReceivedMessageSize。我是否還需要將日誌記錄添加到web.config文件中? – user1823747
是的,添加跟蹤web.config,因爲它可能是服務器端的錯誤。 –