Red Swan
Red Swan

Reputation: 15545

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

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>

Upvotes: 1

Views: 767

Answers (1)

SliverNinja - MSFT
SliverNinja - MSFT

Reputation: 31641

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

See this post for reference.

Upvotes: 1

Related Questions