我有一个返回对象列表的 Web 服务方法List<T>
当列表的长度为 9000 个对象左右时,服务可以很好地返回此列表,但是当长度为 12000 个或更多对象时,服务会返回错误:
底层连接已关闭:连接意外关闭。
`System.Reflection.TargetInitationException:调用目标已引发异常。 ---> Microsoft.FSharp.Core.FailureException:System.Net.WebException:底层连接已关闭:连接意外关闭。
在 System.Net.HttpWebRequest.GetResponse()
在.$Type.httprequest.webRespBase@162@162(DelegatingHttpReq x@162,单位_unit)
在.$Type.httprequest.webRespBase@162@162(DelegatingHttpReq x@162,单位_unit)
在 Storm.Types.WebHttp.DelegatingHttpReq.GetResponse()
在 System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest 请求)
在 System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest 请求)
在System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串方法名称,对象[]参数)
在 ServiceLogic.LoadRestriccionCanalPlano(字符串 CodRuta,字符串 CodTipoRuta)
--- 内部异常堆栈跟踪结束 ---
在 System.RuntimeMethodHandle._InvokeMethodFast(对象目标,Object[] 参数,SignatureStruct& sig,MethodAttributes methodAttributes,RuntimeTypeHandle typeOwner)
在System.Reflection.RuntimeMethodInfo.Invoke(对象obj,BindingFlags invokeAttr,Binder活页夹,Object []参数,CultureInfo文化,布尔skipVisibilityChecks)
在System.Reflection.RuntimeMethodInfo.Invoke(对象obj,BindingFlags invokeAttr,Binder活页夹,Object []参数,CultureInfo文化)
在[电子邮件受保护] /cdn-cgi/l/email-protection(对象[]方法参数@41)
在 .$Type.bgworker.run@51@57_2.Invoke(DoWorkEventArgs dArgs)
在.$Type.bgworker.run@51@57_1.Invoke(对象发送者,DoWorkEventArgs e)
在 System.ComponentModel.BackgroundWorker.WorkerThreadStart(对象参数)`
我尝试过改变maxBufferSize
maxBufferPoolSize
maxReceivedMessageSize
maxStringContentLength
maxArrayLength
等等在Web.config的绑定配置中,但它仍然不起作用。
还有其他想法吗?
我已经在这篇文章中找到了解决方案底层连接已关闭:连接意外关闭 https://stackoverflow.com/questions/285345/the-underlying-connection-was-closed-the-connection-was-closed-unexpectedly
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)