开发者

C# Web service client Thread was being aborted

开发者 https://www.devze.com 2023-03-16 04:31 出处:网络
in this opportunity i\'m facing a very weird problem when try to call a web service method multiples times. for some reason after several invokes i get the following exception. Thread was being aborte

in this opportunity i'm facing a very weird problem when try to call a web service method multiples times. for some reason after several invokes i get the following exception. Thread was being aborted and this is the trace of that exception:

at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
at System.Net.Connection.PollAndRead(HttpWebRequest request, Boolean userRetrievedStream)
at System.Net.ConnectStream.PollAndRead(Boolean userRetrievedStream)
at开发者_JS百科 System.Net.HttpWebRequest.EndWriteHeaders(Boolean async)
at System.Net.HttpWebRequest.WriteHeadersCallback(WebExceptionStatus errorStatus, ConnectStream stream, Boolean async)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
at System.Net.HttpWebRequest.EndSubmitRequest()
at System.Net.HttpWebRequest.CheckDeferredCallDone(ConnectStream stream)
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

This is happening in my production environment, and when i try to reproduce the bug in my developer o test environment it works properly, so i really dont know what it exactly the problem that is occurring with this invocation.

can you guy give me an advice in order to solve this issue.

thanks in advance.


I would enable WCF trace logging on the server, and check the service log after the error occurs. See here: http://msdn.microsoft.com/en-us/library/aa702726.aspx

If/When errors occur in the WCF stack, outside your application code, like serialization and endpoint errors, then end up in the service log.


Edit:

Also, I think the error and stack trace you provided are from the client's perspective. There was likely an exception on the server that caused the server to not properly reply to the client, hence the client's error. The server is where you should be looking for the root cause of this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消