我的WCF服务绑定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才能成功地被服务接收吗?
发布于 2018-03-20 16:36:28
尽管大小为maxArrayLengthm maxDepth、maxNameTableCharCount、maxStringContentLength、maxBytesPerRead的绑定属性可能会让您感到困惑
看起来你问题的根源是请求超时了。您可能需要在服务/客户端配置中增加SendTimeout和ReceiveTimeout属性。
您可能也会看到类似的问题。
WCF Service , how to increase the timeout?
还有这个。
https://stackoverflow.com/questions/49377949
复制相似问题