Whenever I try to save the xmlString as a text file through server using wcf Service, I keep getting the following error:
The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'saveAnnotations'. 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 21897.
I get this exception whenever I try to save the xmlstring by calling the wcf service.
Below are my WebConfig (Client Configuration settings) and AppConfig (Server Configuration settings):
Webconfig Settings
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IConversion" closeTimeout="00:10:00" openTimeout="00:10:00"
sendTimeout="00:10:00" bypassProxyOnLocal="false" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8092/ServiceModelSamples/service"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IConversion"
contract="ConversionEngineService.IConversion" name="WSHttpBinding_IConversion">
<identity>
<servicePrincipalName value="host/PrasenjitDas-PC" />
</identity>
</endpoint>
</client>
</system.serviceModel>
AppConfig Settings:
<system.serviceModel>
<client />
<services>
<service name="ConversionEngineService.Conversion"
behaviorConfiguration="ConversionServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8099/ServiceModelSamples/service"/>
</baseAddresses>
</host>
<!-- this endpoint is exposed at the base address provided by host: http://localhost:8000/ServiceModelSamples/service -->
<endpoint address="http://localhost:8092/ServiceModelSamples/service"
binding="wsHttpBinding"
contract="ConversionEngineService.IConversion" />
<!--bindingConfiguration="SecureHttpBinding" name="SecureHttp"-->
<!-- the mex endpoint is exposed at http://localhost:8099/ServiceModelSamples/service/mex/ -->
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings >
<wsHttpBinding>
<binding name="wsHttpBinding"
messageEncoding="Mtom" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"/>
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ConversionServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="False"/>
<serviceThrottling maxConcurrentCalls="500"
maxConcurrentInstances ="100"
maxConcurrentSessions ="200"/>
<!--added by hr on 31.10.2013-->
<dataContractSerializer maxItemsInObjectGraph="2147483647" ignoreExtensionDataObject="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>