【发布时间】: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 才能成功被服务接收?
【问题讨论】:
-
查看这个解释 maxStringContentLength 代表什么的答案:stackoverflow.com/a/36931852/5311735
标签: c# wcf web-config