none
maxReceivedMessageSize reached RRS feed

  • Question

  • Hello,

    I tried to send bigger files from the server to me.I tried a version with

    name="BasicHttpBindingSettings"

    and also without it. Nothing worked.

    Web.config - Configuration:
    <?xml version="1.0"?>
    <configuration>

      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.7.2" />
        <httpRuntime targetFramework="4.7.2"/>
      </system.web>
      <system.serviceModel>
            <!-- mychange -->
            <bindings>
            <wsHttpBinding>
                <binding name="BasicHttpBindingSettings" maxReceivedMessageSize="2147483647"/><!-- add name="BasicHttpBindingSettings" is the 2nd trial -->
            </wsHttpBinding>
            </bindings>
            <!-- end of mychange -->
            <services>
                <service name="GettingStartedLib.CalculatorService">
                    <host>
                        <baseAddresses>
                            <add baseAddress = "http://localhost:8000/GettingStarted/CalculatorService/" />
                        </baseAddresses>
                    </host>
                    <endpoint address="" binding="wsHttpBinding" name="BasicHttpBindingSettings" contract="GettingStartedLib.ICalculator"><!-- add name="BasicHttpBindingSettings" is the 2nd trial -->
                        <!--<identity>
                            <dns value="localhost"/>
                        </identity>-->
                    </endpoint>
                </service>
            </services>

            
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
            
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
            
      </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>

    I then updated the server and afterwards also the client, but the client didn't received the change in  the configuration91.svinfo file:

            <property path="/maxReceivedMessageSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
              <serializedValue />
            </property>

    Thursday, August 8, 2019 10:14 AM

All replies

  • Hi,
    Your thought is correctly, at first we definite the binding configuration which has set up the MaxReceivedMessageSize attribute, and then apply the binding configuration on the service endpoint. There is a small problem during applying the configuration.  Ordinarily, we apply the binding configuration by using BindingConfiguration attribute instead of the Name attribute. Please refer to the below code segments.

       <bindings>
          <wsHttpBinding>
            <binding name="mybindingconfiguration" maxReceivedMessageSize="2147483647"></binding>
          </wsHttpBinding>
        </bindings>
        <services>
          <service name="WcfService1.Service1">
            <endpoint address="" binding="wsHttpBinding" contract="WcfService1.IService1" bindingConfiguration="mybindingconfiguration"></endpoint>
          </service>
    </services>
    

    Feel free to let me know if the problem still exists.
    Best Regards
    Abraham

    Friday, August 9, 2019 2:24 AM
    Moderator