0

I am trying to send a large json string to a WCF Service created with the WCF REST Service Template. If the string is longer 8000 characters I get a "HTTP/1.1 400 Bad Request" error. I have tried added this to my web config:

    <bindings>
        <webHttpBinding>
            <binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"/>
        </webHttpBinding>
    </bindings>

Any ideas?

BankZ
  • 2,204
  • 1
  • 12
  • 8

1 Answers1

2

You must also setup readerQuotas if you want to pass large strings:

<bindings>
    <webHttpBinding>
        <binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
           <readerQuotas maxStringContentLength="50000" />
        </binding>
    </webHttpBinding>
</bindings>
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670