none
Increasing size limit of request packet RRS feed

  • Question

  • Hi,

    I am adding a feature in my .NET project, which requires to send a json object and receive certain data from the rest api.

    But in the json array, one of my value sometimes cross 64 characters, and that time there is a timeout.

    How to increase this limit?
    Friday, August 24, 2018 11:37 AM

All replies

  • Hi,

    >But in the json array, one of my value sometimes cross 64 characters, and that time there is a timeout.

    For the size of the string content. We could use the readerquotas tag. For the limitation of the sendtimeout, receiveTimeout, we could increase the limitation by setting the attribute of binding.

    You could refer to the following config.

    <bindings>
          <webHttpBinding>
            <binding name="mybinding"
              maxBufferPoolSize="2147483647"
              maxReceivedMessageSize="2147483647"
              maxBufferSize="2147483647" transferMode="Streamed" sendTimeout="00:10:00" receiveTimeout="00:10:00">
              <readerQuotas
                maxDepth="2147483647"
                maxStringContentLength="2147483647"
                maxArrayLength="2147483647"
                maxBytesPerRead="2147483647" />
            </binding>
          </webHttpBinding>
    </bindings>

    Do not forget to ensure the configuration has been applied correctly.

    <services>
      <service name="sv">
        <endpoint address=""
          binding="webHttpBinding " bindingConfiguration="mybinding"
          contract="isv" />
      </service>
    </services>

    Here is official document about the meaning of these attributes.

    https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/configuring-timeout-values-on-a-binding

    https://msdn.microsoft.com/en-us/library/ms731325%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    Feel free to let me know if you have any questions.

    Best Regards

    Abraham
    Tuesday, August 28, 2018 1:29 AM
    Moderator