The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.

Recently i got error on my WCF service. which is something like “The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.”

The error says clearly that it has not able to read more than 8192 string length. WCF service by default set 8192 string length for security to prevent not submit more data. But, in my case i need more data to send. so, i have set following things in my bindings and all done.




maxStringContentLength is set length and solve the problem.

Hope it will help you other also..

Use space value in QueryString

Hello all,

Today we will talk on query string value. We are using query string to pass value from one page to another page. Some time we need to pass value as string and string has some space value too. That time we are not getting exact value on another page because query sting is not pass correctly.

For e.g.

some text

OUTPUT :
str = test

To solve this problem we have to encode url. URL does not contain spaces.
There are two possible solution of this problem one is remove space from url another one is encode/decode url.

StringBuilder sb = new StringBuilder();
string strValue = "test value";
sb.Append("" + some text + "");
sb.Append("");

another way is

StringBuilder sb = new StringBuilder();
string strValue = "test value";
sb.Append("" + some text + "");
sb.Append("");

OUTPUT :
str = test value

HttpUtility is referenced to System.Web class. I prefer to use HttpUtility because it will eliminate space and other characters too.