1
votes

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:GetFileResult. The InnerException message was 'There was an error deserializing the object of type WindowsClient.CloudServiceProxy.GetFileResponse. 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 41572.'. Please see InnerException for more details. I am getting this issue the sever web.config is

<system.serviceModel>
    <services>
  <service behaviorConfigura

tion="CloudServiceBehaviour" name="Web.CloudService">
        <endpoint name="CloudServiceClientEndPoint" bindingConfiguration="CloudBindingConfig" address="http://localhost:53243/CloudService.svc" binding="wsHttpBinding" contract="Web.ICloudService"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="CloudServiceBehaviour">
          <serviceMetadata httpGetEnabled="True" httpGetUrl=""/>
          <serviceDebug includeExceptionDetailInFaults="true" />

        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsHttpBinding>
        <binding name="CloudBindingConfig" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="200" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </wsHttpBinding>
    </bindings>
  </system.serviceModel>

and the client web.config is ,

<system.serviceModel>
        <bindings>
            <wsHttpBinding>
              <binding name="CloudServiceClientEndPoint" closeTimeout="00:01:00"
 openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:01: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="2147483647" maxNameTableCharCount="2147483647" />
                <reliableSession ordered="true" inactivityTimeout="00:30:00"
                  enabled="false" />
                <security mode="Message">
                  <transport clientCredentialType="Windows" proxyCredentialType="None"
                    realm="" />
                  <message clientCredentialType="Windows" negotiateServiceCredential="true"
                    algorithmSuite="Default" />
                </security>
              </binding>
            </wsHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:53243/CloudService.svc" binding="wsHttpBinding"
            contract="CloudServiceProxy.ICloudService" name="CloudServiceClientEndPoint" />
        </client>
    </system.serviceModel>
1
In your client web.config try adding to your <endpoint> bindingConfiguration="CloudServiceClientEndPoint"MLF

1 Answers

2
votes

Since the error is while deserializing the GetFileResponse object, that tells you the problem is in the client-side stack.

Your client side binding is using the default configuration for wsHttpBinding because you have omitted to specify the bindingConfiguration name on the endpoint. Try adding bindingConfiguration="CloudServiceClientEndPoint" to the endpoint element and then your large values for the readerQuotas settings will be picked up.