Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
I received the following error while calling a method .
The senario is as follows wcf webservice viz(A) and wcf webservice viz(B)
webservice A is called by Webservice b which in turn is called by c# application.

The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'Post'. 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 10214.

this is my binding of client c# application
XML
<bindings>
<basicHttpBinding>
<binding name="LongFields" closeTimeout="00:01:00"
 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
 maxBufferSize="2147483647" maxBufferPoolSize="21474836473" maxReceivedMessageSize="2147483647"
 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
 useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
 maxBytesPerRead="40967" maxNameTableCharCount="2147483647" />
 <security mode="None">
 <transport clientCredentialType="None" proxyCredentialType="None"
  realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>


<endpoint address=""
 binding="basicHttpBinding" bindingConfiguration="LongFields"
 contract="V.IService" name="LongFields" />


and this is my webservice config
XML
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
 maxBufferSize="2147483647" maxBufferPoolSize="21474836473" maxReceivedMessageSize="2147483647"
 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
 useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
 maxBytesPerRead="40967" maxNameTableCharCount="2147483647" />
 <security mode="None">
 <transport clientCredentialType="None" proxyCredentialType="None"
 realm="" />
 <message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>


 <endpoint address=""
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
    contract="V.IService" name="BasicHttpBinding_IService" />
Posted

Take a look here[^]
It looks like they have a solution to your problem.
 
Share this answer
 
ExcelledProducts CEO thanks for link
but it dint solve my problem the error is still present
i entered the following tag in web.config file of the webservice
XML
<system.web>
     <httpruntime maxrequestlength="2097151" />

  </system.web>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900