9

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.

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.

4

2 回答 2

15

为了确保获取您为绑定指定的值,您必须将绑定的名称从<binding>元素分配给元素的 bindingConfiguration 属性<endpoint>。如果不这样做,WCF 将使用指定绑定的默认值。

<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”指定为<binding>元素中的名称。因此,在您的端点中执行以下操作:

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

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

于 2011-08-03T02:55:59.857 回答
1

您应该检查您的客户端应用程序以了解它是否使用默认绑定配置。确认这一点的更快方法是在详细级别捕获 WCF 跟踪并检查 Construct ChannelFactory 活动的事件。

HTH,阿米特·巴蒂亚

于 2011-08-03T11:20:43.953 回答