从 WCF 服务读取字节数组到 ASP.NET MVC 3 时出现 Maximumsize 问题
我正在从 WCF Web 服务读取字节数组中的 pdf,并将其返回到 Web 应用程序以准备临时文件。但不知怎的,我遇到了这个异常:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element
从 WCF 服务读取字节数组时。
我在网络应用程序中的绑定标签如下。 我也尝试用 2147483647 替换数字 104857600 。但问题仍然存在。 有人可以帮忙吗?我缺少什么?
<binding name="BasicHttpBinding_IService" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="104857600" maxBufferPoolSize="104857600" maxReceivedMessageSize="104857600"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="104857600" maxStringContentLength="104857600" maxArrayLength="104857600"
maxBytesPerRead="104857600" maxNameTableCharCount="104857600" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
I am reading the pdf in byte array from my WCF web service and returning it to the web application to prepare the file temporary. But somehow I am getting this exception:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element
While reading the Byte Array from WCF service.
My binding tag in web application is as follows.
I tried to replace the number 104857600 with 2147483647 also. But the issue is still there.
Can somebody help? What I am missing?
<binding name="BasicHttpBinding_IService" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="104857600" maxBufferPoolSize="104857600" maxReceivedMessageSize="104857600"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="104857600" maxStringContentLength="104857600" maxArrayLength="104857600"
maxBytesPerRead="104857600" maxNameTableCharCount="104857600" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能还需要在 WCF 服务主机上包含这些相同的绑定配置。
请参阅这篇文章以供参考。
You likely need to include these same binding configurations on the WCF service host as well.
See this post for reference.