štvrtok 16. februára 2012

An error (The request was aborted: The request was canceled.) occurred while transmitting data over the HTTP channel.

I got this error when transmitting large file (byte array) to WCF service.

I double checked my web.config,

Code Snippet
  1. <bindings>
  2.       <basicHttpBinding>
  3.         <binding
  4.           name="BasicWithMtom"
  5.           maxReceivedMessageSize="2621440"
  6.           messageEncoding="Mtom">
  7.           <readerQuotas maxArrayLength="2621440"/>
  8.         </binding>
  9.       </basicHttpBinding>
  10.     </bindings>

but sizing was good enough.

The problem is, that the WCF service is hosted on IIS and  you need to configure quotas on two separated places!!

Add this:

Code Snippet
  1. <system.webServer>
  2.   <httpRuntime maxRequestLength="2621440" />
  3. </system.webServer>


Everything is working now..

Have a nice day!

1 komentár:

  1. I beleive your value is wrong, when i enter 2621440, there is an error saying that the value must be in between 0-2097151

    OdpovedaťOdstrániť