ranjan pati

ranjan pati

  • NA
  • 9
  • 12.8k

WCF | The formatter threw an exception while deserializing

Mar 24 2014 2:31 AM
Dear Madam/Sir,
 
I am using N-Tire application and for SOA using WCF-wsHttpBinding for all tires.
There is wizward type application and all page data are getting saved in xml file.
 
When submitting the the finish button, the data is going to Data Layer through BLayer.  There is add more concept is the pages. If the xml file is less than 8 KB it is going well, but when exceeding this showing following error. Kindly help.
 
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:objApply. The InnerException message was 'There was an error deserializing the object of type DARS_BAL.DataLayerService.Apply. 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 190, position 32.'. Please see InnerException for more details. 
 
 
My Web.config setting is:
 
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IBusinessService" closeTimeout="00:05:00"
openTimeout="00:05:00" receiveTimeout="00:50:00" sendTimeout="00:05:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="65536" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IAdminBAL" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="">
<extendedProtectionPolicy policyEnforcement="Never"/>
</transport>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAdminBAL"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://csmbhul020.corp.csmpl.com/darsbal/DarsBusinessService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBusinessService"
contract="BlayerService.IBusinessService" name="WSHttpBinding_IBusinessService" behaviorConfiguration="DARS_EP_Behavior">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="http://server20/Admin_bal/AdminBAL.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAdminBAL" contract="AdminBALRef.IAdminBAL" name="BasicHttpBinding_IAdminBAL"/>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="DARS_EP_Behavior">
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
 
Waiting for your favourable replay.
Regards,
Ranjan Pati
07735598795 

Answers (7)