已超出最大命名表字符数配额 (16384)
当我尝试与 WCF 服务通信时,出现以下错误:
已超出最大命名表字符数配额 (16384) 读取 XML 数据时。名称表是一种数据结构,用于 存储 XML 处理过程中遇到的字符串 - 长 XML 文档 具有不重复的元素名称、属性名称和属性值 可能会触发此配额。该配额可以通过更改 XmlDictionaryReaderQuotas 对象的 MaxNameTableCharCount 属性 创建 XML 读取器时使用。第 4 行,位置 283。
我尝试通过添加 readerQuotas 如此处建议的,但我仍然遇到相同的错误。
...
<bindings>
<basicHttpBinding>
<binding name="oseo_basicHTTP_binding">
<readerQuotas maxDepth ="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="oseo">
<host>
<baseAddresses>
<add baseAddress="http://localhost:56565/" />
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="oseo_basicHTTP_binding" contract="Ioseo" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
...
编辑#1: 一些背景信息:
此 web.config 位于服务端。我使用 SoapUI 作为客户端,而不是 .NET 客户端。
When i try communicating with my WCF service i get the following error:
The maximum nametable character count quota (16384) has been exceeded
while reading XML data. The nametable is a data structure used to
store strings encountered during XML processing - long XML documents
with non-repeating element names, attribute names and attribute values
may trigger this quota. This quota may be increased by changing the
MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object
used when creating the XML reader. Line 4, position 283.
I tried increasing my maxNameTableCharCount
by adding readerQuotas as suggested here but i still get the same error.
...
<bindings>
<basicHttpBinding>
<binding name="oseo_basicHTTP_binding">
<readerQuotas maxDepth ="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="oseo">
<host>
<baseAddresses>
<add baseAddress="http://localhost:56565/" />
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="oseo_basicHTTP_binding" contract="Ioseo" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
...
EDIT #1:
Some background info:
This web.config is on the service side. I'm using SoapUI as the client and not a .NET client.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您在
name 属性中拥有服务类的完全限定名称代码> 元素。您的合约类位于DataContract
命名空间 (DataContract.Ioseo) 上。如果服务类也在同一命名空间中,则您需要具有以下内容:Make sure that you have the fully-qualified name of the service class in the
name
attribute of the<service>
element. Your contract class is on theDataContract
namespace (DataContract.Ioseo). If the service class is also in the same namespace, this is what you need to have: