我正在使用 WSE Web 服务在 c# 中开发客户端-服务器应用程序。用户可以做的一件事是通过网络服务将 jpg 图像发送到服务器进行备份。最近发生了奇怪的错误。并非所有用户都会发生这种情况,只有少数用户会发生这种情况。在客户端,例外是
System.Net.WebException Exception message: The operation has timed out
并在服务器上的事件查看器中发现以下警告:
Exception information:
Exception type: HttpException
Exception message: Server cannot clear headers after HTTP headers have been sent.
Request information
Request URL: MyUrl/Service.asmx
Request path: /MyWebService/Service.asmx
User host address: -------
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 7
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.HttpResponse.ClearHeaders()
at System.Web.Services.Protocols.SoapServerProtocol.WriteException(Exception e, Stream outputStream)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
有谁知道这个错误可能来自哪里?我已经尝试将 web.config 中的“maxRequestLength”提高到 16Mb,但这并不能解决问题。
问候/丹尼尔