none
Request Entity Too large 413 error RRS feed

  • Question

  • web config...details  
     
    <binding name="webHttpBinding_IMedimizerAPIExportImport" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:40:00" openTimeout="00:40:00" closeTimeout="00:40:00" sendTimeout="00:40:00">
    <readerQuotas maxDepth="214748364" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    <security mode="None" />
    </binding>
     
     
     and client side calling 
    as below  string sResult = webClient.UploadString("http://localhost:98/MedimizerAPIExportImport.svc/ReadWorkorderfromSerial/1/1d8435b839614e4b", "POST", data); 
     
    also, update ISS request filtering and uploadReadAheadSize.
     
    Please suggest...? 
    Friday, April 13, 2018 5:49 AM

Answers

  • Hi VIVEK,

    You should not configure the bindingConfiguration in your endpoint, otherwise, it would not take any effect.

    Please try configuration below:

    <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpBinding_IMedimizerAPIExportImport" contract="IMedimizerAPIExportImport" />

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 17, 2018 1:29 AM

All replies

  • Hi VIVEK,

    As my experience, we could resolve this error by setting maxReceivedMessageSize. But, it seems it did not work for you. Could you share us your complete web.config?

    What is the size for your file to upload?

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 13, 2018 6:47 AM
  • Hi Tao,

    Please find server-side web config as below:

    i am passing Json Object size 119302 bytes, When size less then 100000 Bytes then its work properly...

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />    
        <add key="AppPath" value="E:\Trunck\PL\bin\Debug" />
        <add key="version" value="" />
        <add key="ReleaseDate" value="" />
        <add key="Name" value="Demo" />
      </appSettings>
      <system.web>
        <compilation targetFramework="4.0" />
        <httpRuntime targetFramework="4.0"  />
            <authentication mode="Forms" />
      </system.web>
      <system.serviceModel>
        <services>
          <service name="MedimizerAPIExportImport" behaviorConfiguration="ServiceBehaviour">
            <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" contract="IMedimizerAPIExportImport" />
            <host>
              <baseAddresses>
               <add baseAddress="http://localhost:98/MedimizerAPIExportImport.svc" />
                <!--<add baseAddress="http://192.168.1.67:92/DatrendImportExport.svc"/>-->
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <endpointBehaviors>
            <behavior name="web">
              <webHttp />
       <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </endpointBehaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviour">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
       <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
         <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <webHttpBinding>
            <binding name="webHttpBinding_IMedimizerAPIExportImport" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:40:00" openTimeout="00:40:00" closeTimeout="00:40:00" sendTimeout="00:40:00">
              <readerQuotas maxDepth="214748364" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None" />
            </binding>
          </webHttpBinding>
        </bindings>
        <protocolMapping>
          <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true" />
      </system.webServer>
    </configuration>
    <!--ProjectGuid: {d1a23016-6a34-4d21-a44a-0a426f15465e}-->



    Monday, April 16, 2018 1:25 PM
  • You can't treat the Binding on the service-side like you do on the client-side. The service-side must use a Custom binding on the service side to override the settings you're trying to override on the binding, and you point to the Custom binding.

    https://www.codeproject.com/Tips/243357/WCF-Custom-Binding

    Monday, April 16, 2018 9:16 PM
  • Hi VIVEK,

    You should not configure the bindingConfiguration in your endpoint, otherwise, it would not take any effect.

    Please try configuration below:

    <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpBinding_IMedimizerAPIExportImport" contract="IMedimizerAPIExportImport" />

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 17, 2018 1:29 AM
  • Thanks a lot, Tao...

    I miss it in web config file, need one more suggestion once I call it from client side after 2 minute 

    {"The operation has timed out"} error on the client side. as per my web config, receiveTimeout set 40 minutes

    but request already called so our process completed. but client side does not reflect successfully message.

    is required receiveTimeout on the client side too?

    Tuesday, April 17, 2018 6:20 AM
  • I would suggest you configure the time out settings in the client too.

    If you still receive this error, I would suggest you post a new thread, and then we could discuss this issue separately.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 17, 2018 6:23 AM
  • OK, i will post new thread :)
    Tuesday, April 17, 2018 6:36 AM