【问题标题】:What is the difference between ReaderQuota's maxStringContentLength vs Bindings maxReceivedMessageSizeReaderQuotas maxStringContentLength vs Binding maxReceivedMessageSize 有什么区别
【发布时间】:2018-03-20 06:53:19
【问题描述】:

我有 WCF 服务,Bindings maxReceivedMessageSize 设置为 2000000,ReaderQuota 的 maxStringContentLength 设置为 128000

使用此 wcf 服务的客户端无法发送长度为 200K(400000 字节)的字符串,它会引发以下错误。

远程服务器返回了意外响应:(400) 错误请求。 ---> System.Net.WebException:远程服务器返回错误:(400)错误请求。

在 System.Net.HttpWebRequest.GetResponse()

在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan 超时)

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

是否应该将 maxStringContentLength 属性增加到大于 400000 才能成功被服务接收?

【问题讨论】:

标签: c# wcf web-config


【解决方案1】:

尽管尺寸maxArrayLengthmmaxDepthmaxNameTableCharCountmaxStringContentLengthmaxBytesPerRead 的绑定属性可能会让您失望

您的问题的根源似乎是请求是超时。您可能需要在服务/客户端配置中增加SendTimeoutReceiveTimeout 属性。

你也可以看看这个类似的问题

WCF Service , how to increase the timeout?

还有这个

Large Data and Streaming

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-01
    • 2023-03-22
    • 2011-05-23
    • 2020-03-30
    • 2011-05-29
    • 1970-01-01
    • 2014-07-01
    相关资源
    最近更新 更多