Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF service The maximum array length quota (16384) has been exceeded

I have a wsf service and a client application. While trying to communicate the client and the service I've gotten the following message:

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:blob. The InnerException message was 'There was an error deserializing the object of type FileBlob. 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 25931.'. Please see InnerException for more details."

I have the customBinding element and it doesn't allow me to insert "readerQuotas" section. In both the client and service configs I have the following binding element:

<customBinding>
  <binding name="LicenseServiceBinding"
                closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
      <security authenticationMode="UserNameOverTransport">
          <localClientSettings maxClockSkew="00:07:00" />
          <localServiceSettings maxClockSkew="00:07:00" />
      </security>
      <windowsStreamSecurity />
      <httpsTransport maxReceivedMessageSize="2147483646"/>          
  </binding>
</customBinding>

Thanks in advance for any help:)

like image 667
Dmitry Baranovsky Avatar asked Jun 18 '10 08:06

Dmitry Baranovsky


2 Answers

Actually, I've solved the problem by adding readerQuotas within textMessageEncoding section. Thanks for the help.

<textMessageEncoding messageVersion="Soap11">
          <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="2147483646" maxBytesPerRead="4096" maxNameTableCharCount="5242880"/>
</textMessageEncoding>
like image 119
Dmitry Baranovsky Avatar answered Nov 04 '22 22:11

Dmitry Baranovsky


You should be able to add a <readerQuotas> element inside the <binding> element:

<customBinding> 
  <binding name="LicenseServiceBinding" 
                closeTimeout="00:01:00" openTimeout="00:01:00" 
                receiveTimeout="00:10:00" sendTimeout="00:01:00"> 
      <security authenticationMode="UserNameOverTransport"> 
          <localClientSettings maxClockSkew="00:07:00" /> 
          <localServiceSettings maxClockSkew="00:07:00" /> 
      </security> 
      <readerQuotas maxArrayLength="32768" />
      <windowsStreamSecurity /> 
      <httpsTransport maxReceivedMessageSize="2147483646"/>           
  </binding> 
</customBinding> 

You mentioned that it "doesn't allow me to insert". What error message do you get?

like image 18
Richard Szalay Avatar answered Nov 04 '22 22:11

Richard Szalay