2012-11-14 4 views
3

Microsoft Service Trace Viewer를 사용하여 예외 로그를 ​​확인하고 있습니다. 예외는 다음과 같습니다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. 

WebService에 최대 및 실행, 그리고 내가 잘 그것을 도달 할 수 있습니다. 동일한 웹 서비스의 메서드를 사용하여 여러 보고서를 생성하고 있는데 하나만 제외하면 모두 괜찮습니다. (이 보고서에는 많은 데이터가 있습니다). 너무 많은 데이터/시간 초과를 반환하는 것과 관련이 있다고 생각하지만 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> 

이 도와주세요, 난 정말 여기에 단서 ...

답변

2

는,보다 구체적인 오류하려고 클라이언트와 모두에 대한 추적을 사용하려면 없어 서비스에 대한 자세한 내용은 아래 링크를 참조하십시오. .svclog 파일이 있으면 추적 뷰어로 파일을 열고 빨간색으로 강조 표시된 활동을 클릭하여 세부 정보를 봅니다. MaxReceivedMessageSize와 같은 WCF 제한을 초과하면 클라이언트 또는 서비스 로그에 나타납니다.

http://msdn.microsoft.com/en-us/library/ms733025.aspx

How to turn on WCF tracing?

+0

답변 해 주셔서 감사합니다. 방금 ​​더 많은 데이터가있는 som dbtables가 있으며 충돌을 재현 할 수있었습니다. 그것은 MaxReceivedMessageSize와 관련이있는 것 같지만, 로그에서이를 확인하는 방법을 모르겠습니다. config 로깅을 확장했습니다. 내 app.config 파일에서 "wcf tracing을 켜는 방법"에서 가져 왔지만 MaxReceivedMessageSize를 초과했다는 메시지가 로그에 표시되지 않습니다. web.config 파일에도 로깅을 추가해야합니까? – user1823747

+0

예, 서버 측에서 오류 일 수 있으므로 web.config에 추적을 추가하십시오. –

0

내가 만난 것과이의 일반적인 원인은 DataContractSerializer 예외입니다. 보통 나를위한 순환 참조입니다.

일반적으로 나는 DataContractSerializer를 사용하여 반환 할 개체를 수동으로 serialize하는 코드 어딘가에 코드 블록을 남겨 두었습니다. 생성하는 예외로부터보다 유용한 메시지를 얻을 수 있습니다.

var xs = new DataContractSerializer(value.GetType()); 
var ms = new MemoryStream(); 
xs.WriteObject(ms, value); 

가 그럼 난 예외를 검사하는 코드를 실행합니다 :

당신이 "값"변수는 한 가정, 여기에 작업을 수행 할 수있는 한 가지 방법입니다.