最大字符串内容长度配额 (8192) [英] The maximum string content length quota (8192)

查看:43
本文介绍了最大字符串内容长度配额 (8192)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

反序列化操作CreateTransactionEntity"的回复消息正文时出错.读取 XML 数据时已超出最大字符串内容长度配额 (8192).可以通过更改创建 XML 阅读器时使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性来增加此配额.

Error in deserializing body of reply message for operation 'CreateTransactionEntity'. 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.

嘿,即使我的 web.config 文件上有一个比生命更大的 readerQuota 节点,我仍然收到此错误...

Hey, I keep getting this error even though I have a larger-than-life readerQuota node on my web.config file...

<system.serviceModel>
<bindings>
  <netTcpBinding>
    <binding name="BindingTcp"  maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" closeTimeout="00:10:00">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                  maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </netTcpBinding>

浏览互联网后,我似乎无法想出一个像样的答案.如果您有任何建议,我将不胜感激.

After browsing the internet on the subject, I can't seem to come up with a decent answer. If you have any advice I would really appreciate it.

推荐答案

为了确保您为绑定指定的值被选中,您必须从 元素添加到 元素的 bindingConfiguration 属性.如果不这样做,WCF 将使用指定绑定的默认值.

In order to ensure the values you specify for the binding are picked up, you must assign the Name of the binding from the <binding> element to the bindingConfiguration attribute of the the <endpoint> element. If you don't, WCF will use the default values for the specified binding.

<system.serviceModel>
  <bindings>
    <netTcpBinding>
      <binding name="BindingTcp"  maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" closeTimeout="00:10:00">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      </binding>
    </netTcpBinding>

在上面的示例中,您已将BindingTCP"指定为 元素中的名称.因此,在您的端点中执行以下操作:

In the example above, you have assigned "BindingTCP" as the name in your <binding> element. So in your endpoint do this:

<endpoint address="net.tcp://some.website.url/yourserivce" binding="netTcpBinding" bindingConfiguration="BindingTCP" contract="IYourContract" />

根据错误的位置(在客户端或服务器上)将决定需要修改哪个配置文件.如果两端都出现错误,请修改两个配置文件.

Depending on where the error is (on the client or on the server) will determine which config file needs to be modified. If the error is happening on both ends, modify both config files.

这篇关于最大字符串内容长度配额 (8192)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆