Problem with app.config

3

I have a problem using my application. In it I call several Web services which download a file in CSV format. The file weighs more than 15 Mb.

When the file is small I can easily download it, but when it reaches 15 Mb it only downloads the same 3 Mb maximum.

I know this is related to the app.config file, and although I have tried several ways I can not change it well.

How would you make these changes?

Here is the code of the arthivo app.config :

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="DashboardSoap" allowCookies="true"
                 maxReceivedMessageSize="200000000"
                 maxBufferSize="200000000"
                 maxBufferPoolSize="200000000">
                  <readerQuotas maxDepth="32"
                       maxArrayLength="2000000"
                       maxStringContentLength="2000000"/>
                    <security mode="Transport" />
                </binding>
                <binding name="DashboardSoap1" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://localhost/testApp/Dashboard.asmx"
                binding="basicHttpBinding" bindingConfiguration="DashboardSoap"
                contract="WS.DashboardSoap" name="DashboardSoap" />
        </client>
    </system.serviceModel>
</configuration>
    
asked by A arancibia 07.03.2016 в 20:58
source

3 answers

0

I see that it is a service asmx in that case to increase the transfer size you should change the configuration

<system.web>
   <httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>

How to: Enable a Web Service to Send and Receive Large Amounts of Data

    
answered by 07.03.2016 / 21:51
source
1

Did you also define the "binding" from your client application?:

Server:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding maxBufferSize="30000000" maxReceivedMessageSize="30000000" />

        </basicHttpBinding>
    </bindings>
</system.serviceModel>

Customer :

WSHttpBinding binding = new WSHttpBinding();
binding.Name = "MyBind";
binding.MaxReceivedMessageSize = 30000000;
    
answered by 07.03.2016 в 21:50
0

In addition to what @LeandroTuttini and @Elenasys suggest

Try adding this to your web.config or app.config

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

You can change the figure by 2147483647 which is the maximum value that can take a Int32

    
answered by 08.03.2016 в 14:17