简体   繁体   English

已超过最大字符串内容长度配额(8192)。增加XmlDictionaryReaderQuotas的MaxStringContentLength属性

[英]The maximum string content length quota (8192) has been exceeded.Increase the MaxStringContentLength property on the XmlDictionaryReaderQuotas

I got the following error when i passed an entity object to a WebService 将实体对象传递给WebService时出现以下错误

The maximum string content length quota (8192) has been exceeded while reading XML data. 读取XML数据时,已超出最大字符串内容长度配额(8192)。 This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader 通过更改在创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxStringContentLength属性,可以增加此配额。

I tried to solve this problem by giving the below code in webconfig of Webservice,but the error still remains. 我试图通过在Webservice的webconfig中提供以下代码来解决此问题,但错误仍然存​​在。 Can anyone Help!!!!! 谁能帮忙!!!!!

 <bindings>
      <wsHttpBinding>
        <binding name="MyService" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                    maxArrayLength="2147483647" maxBytesPerRead="2147483647"
                   maxNameTableCharCount="2147483647" />
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="None" />
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>

You have to set the maximum string content length quota on the server and the client. 您必须在服务器和客户端上设置最大字符串内容长度配额。 So check your client config. 因此,请检查您的客户端配置。 If that is not working, check if you are using the right binding. 如果这不起作用,请检查您是否使用了正确的装订。

Your server side Web config allows large strings, but you also need to modify your client side ServiceReferences.ClientConfig file to reflect that. 您的服务器端Web配置允许使用大字符串,但是您还需要修改客户端的ServiceReferences.ClientConfig文件以体现这一点。

<configuration>
  <system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="Binding_MyService">
                <binaryMessageEncoding />
                <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="yourserviceurlhere"
            binding="wsHttpBinding" bindingConfiguration="Binding_MyService"
            contract="yourcontracthere" name="MyService" />
    </client>
</system.serviceModel>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WCF-读取XML数据时超出了最大字符串内容长度配额(8192) - WCF - The maximum string content length quota (8192) has been exceeded while reading XML data WCF Config修复最大字符串内容长度配额(8192) - WCF Config to fix The maximum string content length quota (8192) has been exceeded “在读取XML数据时已超出最大字符串内容长度配额(8192)”将XML字符串发送到WCF时出错 - “The maximum string content length quota (8192) has been exceeded while reading XML data” error while sending XML string to WCF 将 XML 字符串发送到 WCF 时出现“读取 XML 数据时已超出最大字符串内容长度配额 (8192)”错误 - "The maximum string content length quota (8192) has been exceeded while reading XML data" error while sending XML string to WCF 反序列化类型的对象时发生错误...读取XML数据时超出了最大字符串内容长度配额(8192) - There was an error deserializing the object of type … The maximum string content length quota (8192) has been exceeded while reading XML data WCF阅读器配额最大字符串内容长度配额(8192) - WCF reader quota The maximum string content length quota (8192) 使用Delphi使用WCF - 最大字符串内容长度配额(8192)错误 - Consuming WCF with Delphi - Maximum string content length quota (8192) error WCF REST抛出HTTP 400错误maxstringcontentlength配额(8192) - WCF REST throws HTTP 400 error maxstringcontentlength quota (8192) exceeded 已处理ProtocolException,最大字符串内容长度配额8192 - ProtocolException was handled, Max string content length quota 8192 ServiceStack:读取XML数据时已超出最大数组长度配额(16384) - ServiceStack: The maximum array length quota (16384) has been exceeded while reading XML data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM