我正在使用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,但这不能解决它。
关于/Daniel
发布于 2009-07-13 06:47:00
您是否因为别无选择而使用WSE?这确实是使用它的唯一理由,因为它已经相当过时了。你不能使用WCF吗?
发布于 2010-04-08 23:59:15
我也经历过同样的事情。当我调查这个问题时,我遇到了这个问题。我只想分享我到目前为止的发现。
我在网上找到的东西很简单。通过在web.config文件的system.web部分中增加maxRequestLength (达到一个合理的值),您可以解决这个问题。
我想,除了这一点之外,你对maxRequestLength的默认设置不能处理当你的一个用户通过你的WSE服务发送一个更大的JPG来备份到你的系统中时所呈现的请求的大小。
您可能还希望将时间添加到executionTimeout设置中。
https://stackoverflow.com/questions/1117963
复制相似问题