WCF 错误:101 页面不可用
我在 WCF Rest 服务上遇到这个问题。当数据变得更大(例如超过 1.2MB)时,它会在 Chrome 中显示“错误:101 此网页不可用”。在 Firefox 中,其“连接已重置”。但是,它适用于小数据。顺便说一下,数据只是一个普通的 JSON。
以下是我的配置:
WebConfig(绑定配置):
<basicHttpBinding>
<binding name="basicHttpBindingConfig"
closeTimeout="00:30:00"
openTimeout="00:30:00"
receiveTimeout="Infinite"
sendTimeout="00:30:00"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483646"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webclientHttpBindingConfig"
closeTimeout="00:30:00"
openTimeout="00:30:00"
receiveTimeout="Infinite"
sendTimeout="00:30:00"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483646"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
AppConfig(绑定配置):
<basicHttpBinding>
<binding name="basicBindingForBigArrays"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Mtom">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webHttpBindingConfig"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" >
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483646"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</webHttpBinding>
我已经为此苦苦挣扎了几个小时。非常感谢您的想法。
此致,
I have this problem on WCF Rest service. When the data gets bigger like more than 1.2MB it will give me a "Error:101 This webpage is not available" in chrome. In firefox its "The connection was reset". However, it will work on small data. The data is just a plain JSON by the way.
Below is my configuration:
WebConfig(Binding Configuration):
<basicHttpBinding>
<binding name="basicHttpBindingConfig"
closeTimeout="00:30:00"
openTimeout="00:30:00"
receiveTimeout="Infinite"
sendTimeout="00:30:00"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483646"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webclientHttpBindingConfig"
closeTimeout="00:30:00"
openTimeout="00:30:00"
receiveTimeout="Infinite"
sendTimeout="00:30:00"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483646"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
AppConfig(Binding Configuration):
<basicHttpBinding>
<binding name="basicBindingForBigArrays"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Mtom">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webHttpBindingConfig"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" >
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483646"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</webHttpBinding>
I've been struggling on this for hours now. Your thoughts is greatly appreciated.
Best regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在运行 IIS,则需要确保设置了最大 HTTP 帖子大小:
默认为 8MG,但您可以将其设置为 1MB。有关信息,请查看此处。
If you are running IIS, you need to make sure that max HTTP post size is set:
8MG is the default but your case could be set at 1MB. For info look here.