0

I'm having some trouble with my webservice, the request is exceeding the max int size on my webservice I already had set the webconfig to this, but it didn't work

<httpRuntime targetFramework="4.5.1" executionTimeout="300" maxRequestLength="2147483647" />

is there someway to set this bigger than 2147483647 ?

Yep, I already checked these answers on here but none of them had my solution to this issue

  • Possible duplicate of [Maximum request length exceeded in WCF](https://stackoverflow.com/questions/12951763/maximum-request-length-exceeded-in-wcf) – Trevor May 17 '19 at 19:23
  • Can you share your WCF Configuration? – Marc May 17 '19 at 20:38

2 Answers2

1

Try to add the below configurations.
Binding configuration.

<binding name="mybinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />

DataConstractSerializer.

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
      <behavior name="mybehavior">
          <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>

Don’t forget to apply the configuration between the client-side and server-side (we are supposed to add this configuration on both the client-side and server-side endpoints). Add the bindingConfiguration and behaviorConfiguration in the service section.

  <system.serviceModel>
    <services>
      <service name="WcfService2.Service1" behaviorConfiguration="mybehavior">
        <endpoint address="" binding="wsHttpBinding" contract="WcfService2.IService1" bindingConfiguration="mybinding"/>

Feel free to let me know if the problem still exists.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
0

After a long search we found this solution setting on webservice web.config file

<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="2200000000"/>              
        </requestFiltering>
    </security>
</system.webServer>