che ho visto questo problema postato un milione di volte, ma nessuna delle soluzioni hanno lavorato per me ... Così qui vado:Problema con grandi richieste in WCF
Quando si chiama un servizio WCF ricevo il seguente errore:
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://BlanketImportService.ServiceContracts/2011/06:request . The InnerException message was 'There was an error deserializing the object of type BlanketImport.BlanketImportRequest. 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 44440.'. Please see InnerException for more details.
ho modificato il readerQuotas
sia sul client server, e applicate il tag bindingConfiguration.
Ecco la configurazione del server:
<bindings>
<basicHttpBinding>
<binding name="BilagImportBinding" maxBufferSize="2147483647"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="BlanketImport">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BilagImportBinding" bindingNamespace="http://BlanketImportService.ServiceContracts/2011/06" contract="BlanketImport.IBlanketImport">
</endpoint>
</service>
</services>
E la configurazione client:
<bindings>
<basicHttpBinding>
<binding name="BilagImportBinding" maxBufferSize="2147483647"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/BlanketImport/BlanketService.svc"
binding="basicHttpBinding" bindingConfiguration="BilagImportBinding" contract="BlanketServiceReference.IBlanketService"
name="BasicHttpBinding_IBlanketService" />
</client>
Il nome del servizio è solo "BlanketImport" o è sotto uno spazio dei nomi (come BlanketImport.BlanketImport)? Il valore dell'attributo "nome" dell'elemento '' deve essere il * nome completo del servizio * (spazio dei nomi + nome del tipo), altrimenti WCF non lo troverà. –
carlosfigueira
È il 2015 e le impostazioni di configurazione del wcf continuano ad essere un enigma per molti di noi. – abhi