0

I am facing 413 error in WCF service even if maxReceivedMessageSize is set to max i.e. 2147483647 and actual message size is less than 50kb.

This issue appears only when there is some ideal time between two request. The exact scenario is as below: 1. Send 1000 messages each of them is around 38 kb. STATUS: PASS 2. Wait for sometime(Minimum 3 mins) 3. Send 1 message. STATUS: FAIL. (413 error)

I am using ws2007FederationHttpBinding. Web.config tag is as below:

<ws2007FederationHttpBinding>
    <binding name="federationHttpBinding" openTimeout="00:04:00" closeTimeout="00:04:00" receiveTimeout="00:04:00" sendTimeout="00:40:00" maxReceivedMessageSize="2147483647">
      <!-- <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /> -->
      <security mode="TransportWithMessageCredential">
        <message establishSecurityContext="false">
        </message>
      </security>
    </binding>
  </ws2007FederationHttpBinding>

Client side binding tag is as below:

<ws2007FederationHttpBinding>
    <binding name="AuthorizationBinding" openTimeout="00:04:00" closeTimeout="00:04:00" receiveTimeout="00:04:00" sendTimeout="00:40:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
      <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
      <security mode="TransportWithMessageCredential">
        <message establishSecurityContext="false"/>
      </security>
    </binding>
</ws2007FederationHttpBinding>
Microsoft Developer
  • 5,229
  • 22
  • 93
  • 142

2 Answers2

0

You also have to set maxBufferSize

    <binding name="federationHttpBinding" 
             maxReceivedMessageSize="2147483647" 
             maxBufferSize="2147483647"
             maxBufferPoolSize="2147483647">
Thorarins
  • 1,836
  • 16
  • 21
0

I think you could solve this problem by removing the name attribute from the binding tag, A similar problem could be found here

WCF service maxReceivedMessageSize basicHttpBinding issue

Community
  • 1
  • 1
Khaled El Kholy
  • 136
  • 1
  • 4