当调用ClearHeaders时,WSE 3.0崩溃
问题描述:
我正在使用WSE Web服务在c#中开发客户端 - 服务器应用程序。用户可以做的一件事是将jpg图像发送到服务器,以便通过网络服务进行备份。最近发生了奇怪的错误。这不会发生在所有用户身上,只有少数人。在客户端的例外是当调用ClearHeaders时,WSE 3.0崩溃
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,但这不能解决问题。
问候 /丹尼尔
答
是否使用WSE,因为你别无选择?这是使用它的唯一理由,因为它已经过时了。你无法使用WCF吗?
答
我也经历过同样的事情。当我正在研究这个问题时,我遇到了这个问题。我只是想分享我迄今为止发现的内容。
我在网上发现的东西很简单。通过在web.config文件的system.web部分中增加maxRequestLength(达到理智数量),您可以解决此问题。
我想,没有做过更多的研究,这是因为maxRequestLength的默认设置将无法处理请求的大小,当您的用户发送更大的JPG文件以通过您的系统备份到您的系统WSE网络服务。
您可能希望为执行超时设置添加时间。
其遗憾的是遗留的事情。至少现在没什么可以改变的...... – 2009-07-13 07:58:05