开发者

XmlDictionaryReaderQuota

开发者 https://www.devze.com 2023-03-19 03:15 出处:网络
I am sending voluminous data over the wire from my WPF application. When calling the WCF Service, I get the following error:

I am sending voluminous data over the wire from my WPF application. When calling the WCF Service, I get the following error:

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

My app.config file is as given below :

                    <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        <client>
            <endpoint address="http://localhost:49296/svcPMISService.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPMISService_New"
                contract="PMISService.IPMISService" name="BasicHttpBinding_IPMISService_New" />
        </client>
    </system.serviceModel>
</configuration>

My Web.config is as given below :

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" >
      <reader开发者_运维百科Quotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </basicHttpBinding>
</bindings>
</system.serviceModel>


It seems your app.config is not complete and the app.config and web.config don't match. Where is the binding configuration BasicHttpBinding_IPMISService_New defined?

Going on the example config provided right now the binding configuration BasicHttpBinding_IPMISService_New is not defined. Change that on the endpoint to BasicHttpBinding and see if it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消