服务参考返回值大小问题



我有一个Web服务方法,它返回对象列表List<T>

当列表的长度大约是9000个对象时,服务会很好地返回这个列表,但当长度大约是12000个或更多对象时,该服务会返回一个错误:

基础连接已关闭:连接意外关闭。

`System.Reflection.TargetInvocationException:调用的目标引发了异常。--->Microsoft.FSharp.Core.FailureException:System.Net.WebException:基础连接已关闭:该连接意外关闭。位于System.Net.HttpWebRequest.GetResponse()位于$Type.httprequest.webRespBase@162@162(DelegatingHttpReq x@162,Unit _Unit)位于$Type.httprequest.webRespBase@162@162(DelegatingHttpReq x@162,Unit _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(String methodName,Object[]参数)ServiceLogic.LoadRestrictionCanalPlano(字符串CodRuta,字符串CodTipoRuta)

---内部异常堆栈跟踪结束---

在System.RuntimeMethodHandle_InvokeMethodFast(对象目标,Object[]参数,SignatureStruct&sig,MethodAttributes方法属性,RuntimeTypeHandle typeOwner)位于System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder Binder,Object[]参数,CultureInfo区域性,布尔skipVisibilityChecks)位于System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder Binder,Object[]参数,CultureInfo区域性)在Storm.UI.Forms.FormMainOps.clo@651.Invoke(对象[]methodParams@41)位于$Type.bgworker.run@51@57_2.调用(DoWorkEventArgs dArgs)位于$Type.bgworker.run@51@57_1.调用(对象发送器,DoWorkEventArgs e)位于System.ComponentModel.BackgroundWorker.WorkerThreadStart(对象参数)`

我已经尝试更改Web.config上绑定配置中的maxBufferSizemaxBufferPoolSizemaxReceivedMessageSizemaxStringContentLengthmaxArrayLength等,但仍然不起作用。

还有其他想法吗?

我已经在这篇文章中找到了解决方案基础连接已关闭:连接意外关闭

最新更新