How to increase server side MaxStringContentLength for linking Http links

I recently converted some WCF Silverlight 3 services to use the new binary http bindings. Long strings are often sent to the server for deserialization in these services, and I previously used them to ensure that the data is read correctly. However, with the new binding, I cannot find the right place to add the item:

<customBinding> <binding name="binaryHttpBinding"> <binaryMessageEncoding maxReadPoolSize="2147483647" maxSessionSize="2147483647" maxWritePoolSize="2147483647"/> <httpTransport maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/> </binding> </customBinding> 

Here is one try:

  <customBinding> <binding name="binaryHttpBinding"> <binaryMessageEncoding maxReadPoolSize="2147483647" maxSessionSize="2147483647" maxWritePoolSize="2147483647"/> <httpTransport maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/> <textMessageEncoding> <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="200000" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> </textMessageEncoding> </binding> </customBinding> 

This caused other problems - it doesn't seem like a good idea to have binary encoding and textMessageEncoding in the same binding. So using only binary encoding, how can I increase reader quotas to allow deserialization of large strings?

+4
source share
1 answer

Here is the solution I found:

  <customBinding> <binding name="binaryHttpBinding"> <binaryMessageEncoding maxReadPoolSize="2147483647" maxSessionSize="2147483647" maxWritePoolSize="2147483647"> <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="200000" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> </binaryMessageEncoding> <httpTransport maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/> </binding> </customBinding> 
+12
source

All Articles