gpt4 book ai didi

wcf - WCF 中的大请求问题

转载 作者:行者123 更新时间:2023-12-04 05:04:50 26 4
gpt4 key购买 nike

我已经看到这个问题发布了一百万次,但没有一个解决方案对我有用......所以我开始了:

调用 WCF 服务时出现以下错误:

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.



我修改了 readerQuotas在客户端服务器上,并应用了 bindingConfiguration 标记。

这是服务器配置:
<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>

和客户端配置:
  <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>

最佳答案

找到了解决办法……但还是很奇怪!

如果我从绑定(bind)标签中删除 name 属性并从端点标签中删除 bindingConfiguration 属性,则一切正常。这意味着 basicHttpBinding 配置是所有 basicHttpBinding 端点的默认配置

关于wcf - WCF 中的大请求问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7470530/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com