我在通过Web服务发送一个大文件时遇到问题(系统.Web.服务.协议.SoapHttpClientProtocol.ReadResponse)。
当文件小于20 MB时,一切正常,如果文件大于20 MB,我会得到404代码的响应。
例外信息
Exception Type: System.Net.WebException
Status: ProtocolError
Response: System.Net.HttpWebResponse
Message: The request failed with HTTP status 404: Not Found.
Data: System.Collections.ListDictionaryInternal
TargetSite: System.Object[] ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)
HelpLink: NULL
Source: System.Web.Services
堆栈跟踪信息
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at ie.osds.DocumentsTransferBLL.FSDMZRepositoryService.FileStreamingWebService.UploadScanning(DateTime DateCreated, String Title, String FileName, String ReferenceNumber, String Author, String DocumentType, XmlNode IndexData, Byte[] Content, Nullable`1 IsCompressed, Nullable`1 Version, DateTime DateReceived, String CreatedBy, String OrigDocumentGUID)
at ie.osds.DocumentsTransferBLL.Actions.ActionsHelper.UploadDocumentToDMZFileStreaming(FileStreamingWebService fsDMZWebService, SPQDocument spqDocument, String documentReferenceNumber, String documentAuthor, String documentType, Byte[] documentContent, String version, DateTime dateReceived)
at ie.osds.DocumentsTransferBLL.Actions.DocumentsUploadAction.Upload()*
2条答案
按热度按时间yuvru6vn1#
您的档案上传似乎已逾时:
您可以在global.asax中捕获此错误,以查看是否存在以下情况:
您也可以在web.config中增加请求长度,如下所示:
注意:值以KB为单位
9rbhqvlz2#
如果Web应用程序中存在Web服务引用,则只需删除该Web服务引用,然后重新生成,运行该Web服务,然后再次将该Web服务引用添加到Web应用程序中。