none
File Upload Error [413 Request Entity too Large] via WCF RRS feed

  • Question

  • I use TWO PC (1:IIS Server - win7 64bit, 2:Client - win7 64bit), and Client wants to upload large files to IIS Server via WCF.

    BUT Client gets return code [413 Request Entity too Large], and fails to upload files.

    About less than 6.7MB -> Upload OK. About 10MB -> Upload NG.

    I don't know why. Please HELP me About settings.

    My present settings are below, and I want to upload 100MB file (max value).

     

    (1)Client Code (VB.Net)

      ret = ws.UploadFile(data)   ' Dim data() as Byte       -> 413 Error

     

    (2)app.config


     <system.serviceModel>

        <bindings>
             <basicHttpBinding>
            
        <binding name="BasicHttpBinding_IWsFile"
         closeTimeout="00:10:00"
         openTimeout="00:10:00"
         receiveTimeout="00:10:00"
         sendTimeout="00:10:00"
         maxBufferPoolSize="2147483647"
         maxReceivedMessageSize="1073741824"
         maxBufferSize="1073741824"
         transferMode="Buffered"
         messageEncoding="Text">
        
         <readerQuotas
           maxDepth="2000000"
           maxStringContentLength="2147483647"
           maxArrayLength="2147483647"
           maxBytesPerRead="2147483647"
           maxNameTableCharCount="2147483647"/>

        <security mode="None">
         </security>

       </binding>

      </basicHttpBinding>
      </bindings>

     <client>
             <endpoint address=""
                 binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWsFile"
                 contract="WsFile.IWsFile" name="BasicHttpBinding_IWsFile" />
         </client>
        
     </system.serviceModel>

    (3)Web.config


    <system.web>

     <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>

     <!-- 150MB, Timeout=30Minutes -->
      <httpRuntime maxRequestLength="153600" executionTimeout="1800" />  
       
     </system.web>

    <system.webServer>
      <security>
       <requestFiltering>
        <!-- For ASP  1G -->
        <requestLimits maxAllowedContentLength="1000000000" />
       </requestFiltering>
      </security>
     </system.webServer>

    <system.serviceModel>
      <bindings>
        <basicHttpBinding>

      <binding name="LargeBinding"
        maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
        maxReceivedMessageSize="2147483647" messageEncoding="Text"
        textEncoding="utf-8" transferMode="Buffered"
        closeTimeout="00:10:00" openTimeout="00:10:00"
        receiveTimeout="00:10:00" sendTimeout="00:10:00">
       
        <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647"
         maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        
        <security mode="None">
        </security>
       </binding>
         
         
        </basicHttpBinding>
        <wsHttpBinding>
          <binding name="NewBinding0" />
        </wsHttpBinding>
      </bindings>
     
      <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      <services>
        <service name="AbcWs.WsFile"  >
          <endpoint address="" binding="basicHttpBinding" bindingConfiguration="LargeBinding" contract="AbcWs.IWsFile" />
        </service>
      </services>


      <behaviors>
        <serviceBehaviors>
          <behavior>
            <serviceMetadata httpGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="false"/>
            <dataContractSerializer maxItemsInObjectGraph="104857600"/>
           </behavior>
        </serviceBehaviors>
      </behaviors>

    </system.serviceModel>

    (4)IIS Settings

    uploadReadAheadSize = 2147483647

     


    • Edited by saZQ Monday, July 28, 2014 6:25 AM
    • Moved by Amanda Zhu Monday, July 28, 2014 9:34 AM
    Monday, July 28, 2014 6:24 AM

Answers

  • Hi,

    When localhost is used as the target machine name in the endpoint address, WCF/System.Net itself decides to ignore proxy-settings (probably for internal routing/performance reasons). Then we need to use the actual machinename or the IP in the address.
    For more information, please try to refer to the following article:
    http://blogs.infosupport.com/configuring-a-proxy-server-for-wcf/ .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Wednesday, July 30, 2014 7:37 AM
    Moderator

All replies

  • Hi,

    I moved this thread to Windows Communication Foundation, Serialization, and Networking forum for better support.

    Thanks,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 28, 2014 9:34 AM
  • Proxy Server Setting Problem ???

    I've used IE10 and  Internet Options -> [Use Proxy Server] & [NOT Use Proxy Server in Local Address] & [Proxy exceptions list is BLANK].

    Now I changed IE Settings on Client PC  [Proxy exceptions list is 192.168.xx.xx (IP Address of the PC for IIS)],

    And File Upload Success!! I'm so GLAD!!

    Well, I have more question.

    Why does Client PC with [NOT Use Proxy Server in Local Address] setting only fail to upload file?

    Why is it neccessary to add Proxy exceptions list in Client PC ?

    Please Tell me the reason. Thanks.

    Monday, July 28, 2014 2:25 PM
  • Hi,

    When localhost is used as the target machine name in the endpoint address, WCF/System.Net itself decides to ignore proxy-settings (probably for internal routing/performance reasons). Then we need to use the actual machinename or the IP in the address.
    For more information, please try to refer to the following article:
    http://blogs.infosupport.com/configuring-a-proxy-server-for-wcf/ .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Wednesday, July 30, 2014 7:37 AM
    Moderator
  • Amy Peng Wrote :

    > WCF/System.Net itself decides to ignore proxy-settings

    > Then we need to use the actual machinename or the IP in the address.

    Thank you for your reply!

    I set [Proxy exceptions list] when uploading files via WCF.



    • Edited by saZQ Saturday, August 9, 2014 6:15 AM
    Saturday, August 9, 2014 6:15 AM