我有一个返回对象列表的 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(字符串方法名称,对象 [] 参数) 在 ServiceLogic.LoadRestriccionCanalPlano(字符串 CodRuta,字符串 CodTipoRuta)
---内部异常堆栈跟踪结束---
在 System.RuntimeMethodHandle._InvokeMethodFast(对象目标,对象 [] 参数,SignatureStruct& sig,MethodAttributes methodAttributes,RuntimeTypeHandle typeOwner) 在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder Binder ,Object[] 参数,CultureInfo 文化,Boolean skipVisibilityChecks) 在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder Binder ,Object[] 参数,CultureInfo 文化) 在 Storm.UI.Forms.FormMainOps.clo@651.Invoke(Object[] methodParams@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 上的绑定(bind)配置中,但它仍然无法正常工作。
还有其他想法吗?
最佳答案
关于wcf - Service Reference返回值大小问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13498888/