wcf - Service Reference返回值大小问题

标签 wcf web-services reflection

我有一个返回对象列表的 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)配置中,但它仍然无法正常工作。

还有其他想法吗?

最佳答案

我已经在这篇文章中找到了解决方案 The underlying connection was closed: The connection was closed unexpectedly

关于wcf - Service Reference返回值大小问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13498888/

相关文章:

java - 在 java 中设置 Web 服务器的最简单方法是什么?

java - 对类进行反射是否会意外调用方法(例如静态构造函数)?

java - 如何在 Java 中获取变量名?

ios - iOS 中的 Websocket 连接问题?

WCF TCP 客户端——关于如何使用它们的基本指南?

c# - 异常: 'system.data.sqlclient.sqlconnection' 的类型初始值设定项?

c# - 如何获取远程登录用户的 WindowsIdentity?

java - Autowiring Spring NullPointerException

JavaScript:Reflect.get() 和 obj ['foo' 之间的区别]

c# - WCF SOAP 服务不能返回 JSON 作为输出吗?