Click here to Skip to main content
15,916,835 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi All,

I am getting below error while sending large data size (120kb) in wcf. For small size data it's working fine but it fail to send such files having size more than 100 KB.
Please find the error details and Config file details.

Error :-

Error:- Error while sending response to server Details The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'CrawlResponse'. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 47721.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ICrawlResponse.CrawlResponse(Byte[] CrawlResult, Int32 ByteCount)
at Pricing.CrawlManager.Client.SendXmlData.SendData()


Please find the Config details :-

XML
<bindings>
 <basicHttpBinding>
 <binding name="BasicHttpBinding_ICrawlReceiver" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" 
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
maxBufferSize="65536" maxBufferPoolSize="5242880000" 
maxReceivedMessageSize="6553600" messageEncoding="Mtom" 
textEncoding="utf-8" transferMode="Streamed" 
useDefaultWebProxy="true">
  <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
maxNameTableCharCount="2147483647" /> 
 <security mode="None">
  <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
  <message clientCredentialType="UserName" algorithmSuite="Default" /> 
  </security>
  </binding>
  </basicHttpBinding>
  </bindings>
 <client>
  <endpoint address="http://70.84.215.66/Receiver/Receiver" 
binding="basicHttpBinding" 
bindingConfiguration="BasicHttpBinding_ICrawlReceiver" 
contract="localhost.ICrawlReceiver" 
name="BasicHttpBinding_ICrawlReceiver" /> 
  </client>
 <services>
 <service name="Pricing.CrawlManager.Server.ResponseProcessor" behaviorConfiguration="ServiceBehavior">
  <endpoint address="ResponseProcessor" binding="basicHttpBinding" contract="Pricing.CrawlManager.Communication.ICrawlResponse" />



Please help me to fix such issues.

Edit TR : Please used <pre> tags to make your code clearer, XML included.
Posted
Updated 15-Apr-10 11:29am
v5

The error solves the error lol read


basantakumar wrote:
he maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1
 
Share this answer
 
basantakumar wrote:
The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.


Increase those values in config file.It'll solve your problem.
 
Share this answer
 
SQL
HI,

This happens because of the size of response message i.e. when your service prepares the result into a byte[] as response to your request, it finds out that the "Maximum Array Length" is set to 16384 and since your response byte[] would be greater than this limit it throws an exception. In order to cure this problem, open the config file of the project where this WCF service is consumed – ServiceReferences.ClientConfig (Silverlight), app.config (WPF) or web.config(ASP.Net). Here you’ll see the binding settings of the service (please note: you may see multiple bindings, one for each service you have consumed. In this case, identify the binding of the service which is giving this exception)

check this link having solution of your problem

http://scorpiotek.com/blog/?p=393
 
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