Friday, February 06, 2009

Delivering large strings through WCF

If you have trouble sending large strings through WCF (more than 8192 bytes), it is probable you need to configure the parameter ReaderQuotas.MaxStringContentLength (default value is 8192). This parameter should be configured in both sides (client and server) as needed.

Set this by code:

NetTcpBinding tcp = new NetTcpBinding();
tcp.ReaderQuotas.MaxStringContentLength = 65535;


or modifying the config file:

...
<binding name="myTcpBinding">
    <readerQuotas maxStringContentLength="65535" />
    ...
</binding>
...


2 comments:

brandon said...

Hey!

I just wanted to say that I did a blog spotlight on your blog today over at mine: http://dynamics-ax.blogspot.com

It's the top post right now. Anyway keep up the good work!

-Brandon George

Oscar Londono said...

Hi Brandon,

Thanks, you're very nice.

I love sharing all my knowledge... you also have a lot of useful articles... please continue posting!

Good luck!


View My Stats