Getting Maximumsize issue, while reading the Byte Array from WCF service to ASP.NET MVC 3

本小妞迷上赌 提交于 2019-12-13 02:47:10

问题


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>

回答1:


You likely need to include these same binding configurations on the WCF service host as well.

See this post for reference.



来源:https://stackoverflow.com/questions/8177584/getting-maximumsize-issue-while-reading-the-byte-array-from-wcf-service-to-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!