我做了一个winform的上传组件,和一个webservice 服务,通过webservice上传文件到oracle数据中,上传时以文件夹为单位,数据库中有4张表,前三张表存放文件的属性信息,第四张存放文件实体信息。当我上传文件比较多的时候就会报错:The request was aborted: The operation has timed out.System.Net.WebException: The request was aborted: The operation has timed out.
   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)   at Sand.AXHZGT.WSHZGT.FileServ.AppendDocumentContent(Int32 contentID, Byte[] buffer, Int32 length, Int64 offset)---注:AppendDocumentContent()这个方法是向第四张表里添加文件实体信息
   at Sand.AXHZGT.FileUpload.UploadSinglProject(String classPath, String uploader, Boolean isSingle)
Unable to connect to the remote serverSystem.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 
由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 
不知道我表达的清楚不,希望各位哥哥姐姐帮帮忙,弟弟我感激不尽现在我还在试用期,帮帮忙哈!!!!

解决方案 »

  1.   

    几M的,一两个可能没问题..
    文件多了会导致SOCK堵塞的.
      

  2.   

    上传的文件100g左右,是因为sock堵塞引起连接超时的么,怎么解决呢???硬件配置相当好。会不会这个程序一次上传不了这么大的文件,崩溃了我上传的时候以文件夹为单位,每次上传完一个文件夹都会关闭数据库连接的,上传下一个文件夹时再打开连接。。
      

  3.   

    话说.Net上传文件的大小也是有限制的吧
      

  4.   

    你必须等到1个请求结束后在发送第二个或者异步多线程接受(比较复杂)...貌似WEB服务可以设置为异步吧~~~
    强烈建议不要存数据....
      

  5.   

    我只知道, Web Service 与客户端的数据交换是有个限制的,网上搜了下说加下面这句就行:
        <httpRuntime executionTimeout="300" maxRequestLength="40960" useFullyQualifiedRedirectUrl="false"/>
    可上传的时候还有异常:
    异常:
     at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
      

  6.   

    System.Net.Sockets.SocketException: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 192.168.XXX。XXX   这个错误。
      

  7.   

    这个就是堵塞....没好的办法...你发送一个文件事例化一个WEB服务....
    在一个服务上发送是同步会堵塞.
      

  8.   

    我上传30g的没有问题,上传100g的时候就出问题了上传30g的文件需要半个小时左右