我有一个使用wsHttpBinding的WCF服务。服务器配置如下:
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
在客户端,我包含了WCF服务的Service引用。如果我的IService中有限定函数,比如90个Operation Contract,那么它的工作效果很好,但是如果我添加了一个以上的OperationContract,我就无法更新Service引用,也无法添加那个服务引用。在这篇文章中提到,通过更改那些配置文件(即devenv.exe.config、WcfTestClient.exe.config和SvcUtil.exe.config),它会起作用,但即使在这些配置文件中包括这些绑定,仍然会弹出错误,提示:
下载'http://10.0.3.112/MyService/Service1.svc/mex'时出错。 请求失败,HTTP状态码为400: 错误请求。 元数据包含无法解析的引用:'http://10.0.3.112/MyService/Service1.svc/mex'。 XML文档中存在错误(1, 89549)。 读取XML数据时已超过最大名称表字符计数配额(16384)。名称表是一种数据结构,用于存储在XML处理期间遇到的字符串 - 具有非重复元素名称、属性名称和属性值的长XML文档可能会触发此配额。可以通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxNameTableCharCount属性来增加此配额。第1行,第89549个位置。 如果服务在当前解决方案中定义,请尝试构建解决方案并再次添加服务引用。
有什么解决方法吗????
readerQuotas
即可。 - endyourif