0

I know that this question has been asked before, but I have read all of those and I believe that I have implemented all of their suggestions and they don't help.

Fiddler (best tool EVER!) shows that the whole of the message is getting to the server, so the client (and its app.config) is irrelevant.

  • I made sure that the readerquotas/MaxStringContentLength is over 8K.
  • I made sure that maxItemsInObjectGraph is over 8K.
  • I made sure that the binding and behavior are referenced in the endpoint.
  • I made sure that I was indeed connecting to the referenced endpoint (i.e. that the URL was correct).

The error message is:

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

The relevant portion of the web config:

<system.serviceModel> <bindings> <basicHttpBinding> <binding name="DefaultBinding"> <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="DefaultEndpointBehavior"> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> <services> <service name="DmsIntegrationService"> <endpoint behaviorConfiguration="DefaultEndpointBehavior" binding="basicHttpBinding" bindingConfiguration="DefaultBinding" contract="MYCONTRACT" /> </service> </services> </system.serviceModel>

I understand that boosting all of these numbers to int.MaxValue is a potential DOS risk. I will lower them before I publish this.

  • Does your WCF contract and the implementation class not have any namespace? Also can you please post on how your contract looks like? – Rajesh Apr 17 '15 at 13:06

2 Answers2

1

try something like this

<binding name="DefaultBinding" maxBufferPoolSize="524288" maxBufferSize="524288" maxConnections="10" maxReceivedMessageSize="5242880"> <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> </binding>

also refer to this link here

Community
  • 1
  • 1
Tanaji Kamble
  • 353
  • 1
  • 3
  • 17
0

Try putting the things together in the WCF web config

<system.web>
    <httpRuntime maxRequestLength="5120000" />
</system.web>
  <system.webServer>
    <urlCompression doDynamicCompression="true" doStaticCompression="true" />
    <validation validateIntegratedModeConfiguration="false" />
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="1024000000" />
      </requestFiltering>
    </security>
  </system.webServer>
sudhansu63
  • 6,025
  • 4
  • 39
  • 52