[英]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.