I want to set maxArrayLength in basichtttpbiding. But the only way to do this, with out configuration file, is to create a XmlDictionaryReaderQuotas, that doesnt not exsist in System.xml, and put it in BasicHttpBinding1.ReaderQuotas.
What can I do to set the maxArrayLength with out using configuration file ?
EDIT:
I cant do that: basichtttpbiding1.ReaderQuotas.MaxArrayLength = 1000000; becouse I dont have any options to choose after this: basichtttpbiding1.ReaderQuotas.[Options to choose]
Solved.
Need to add manually the reference: System.Runtime.Serialization
and then the class XmlDictionaryReaderQuotas
will be showen in System.Xml
You don't need to create an instance of XmlDictionaryReaderQuotas
. The binding already has one such instance, so you can use it directly:
BasicHttpBinding bhb = new BasicHttpBinding;
bhb.ReaderQuotas.MaxArrayLength = 1000000;
If you're in a platform such as Silverlight, however (and if it's the case, please add the appropriate tag in your question), this property isn't exposed. That's because this quota isn't enforced in that platform - it's essentially the same behavior as if the quota existed, but it was set to the maximum value (int.MaxValue). So you don't need to increase it (it's already max'd out), and you can't decrease it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With