开发者

The maximum string content length quota (8192)

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" open开发者_如何学JAVATimeout="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.


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>

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.


You should check your client application to know if it uses default binding configuration. The quicker way to confirm this is to capture WCF traces at verbose level and check events of Construct ChannelFactory activity.

HTH, Amit Bhatia

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜