views:

778

answers:

1

Am getting following error message on calling WCF service:

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:fieldText. The InnerException message was 'There was an error deserializing the object of type System.String[]. 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. Line 1, position 10889.'. Please see InnerException for more details."

WCF section in my web.config looks like this:

<basicHttpBinding>
        <binding name="BasicHttpBinding_IMySvc" maxReceivedMessageSize="2147483647" sendTimeout="00:05:00"
                 messageEncoding="Text" textEncoding="utf-8" >
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="163840000"/>
        </binding>
</basicHttpBinding>

Also,size of my input message is:15869 characters.

What am I missing here?

+2  A: 

Make sure that your endpoint actually is using the binding.

<endpoint address="" binding="basicHttpBinding" contract="IMySvc" bindingConfiguration="BasicHttpBinding_IMySvc">
Joshua Belden
Yup - just declaring it doesn't really help - it has to be referenced, too :-)
marc_s
ofcourse it does...!otherwise it would have thrown an exception:Could not find default endpoint element that references contract 'MySvc.IMySvc' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
Steve Chapman