服务引用返回值大小问题 [英] Service Reference return value size issue
问题描述
我有一个 Web 服务方法,它返回一个对象列表 List
I have a Web Service method which returns a list of objects List<T>
当列表的长度为9000个左右时,服务很好地返回这个列表,但是当长度为12000个或更多时,服务返回错误:
When the the length of the list is 9000 objects or so, the service returns this list well, but when the length is like 12000 or more objects, the service returns an error:
底层连接已关闭:连接意外关闭.
The underlying connection was closed: The connection was closed unexpectedly.
`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[] parameters)在 ServiceLogic.LoadRestriccionCanalPlano(String CodRuta, String CodTipoRuta)
`System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.FSharp.Core.FailureException: System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly. at System.Net.HttpWebRequest.GetResponse() at .$Type.httprequest.webRespBase@162@162(DelegatingHttpReq x@162, Unit _unit) at .$Type.httprequest.webRespBase@162@162(DelegatingHttpReq x@162, Unit _unit) at Storm.Types.WebHttp.DelegatingHttpReq.GetResponse() 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 ServiceLogic.LoadRestriccionCanalPlano(String CodRuta, String CodTipoRuta)
---内部异常堆栈跟踪结束---
--- End of inner exception stack trace ---
在 System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)在 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(Object argument)`
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Storm.UI.Forms.FormMainOps.clo@651.Invoke(Object[] methodParams@41) at .$Type.bgworker.run@51@57_2.Invoke(DoWorkEventArgs dArgs) at .$Type.bgworker.run@51@57_1.Invoke(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)`
我试过改变 maxBufferSize
maxBufferPoolSize
maxReceivedMessageSize
maxStringContentLength
maxArrayLength
等在 Web.config 上的绑定配置中,但它仍然不起作用.
I've tried changing the maxBufferSize
maxBufferPoolSize
maxReceivedMessageSize
maxStringContentLength
maxArrayLength
etc in the binding configuration on the Web.config, but it still not working.
还有其他想法吗?
推荐答案
我已经在这篇文章中找到了解决方案底层连接已关闭:连接意外关闭
I've already found a solution in this post The underlying connection was closed: The connection was closed unexpectedly
这篇关于服务引用返回值大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!