解决WCF The maximum nametable character count quota (16384) has been exceeded while reading XML data问题
来源:互联网 发布:tsc标签设计软件 编辑:程序博客网 时间:2024/05/22 02:11
今天将客户端程序引用之前创建的一个方法相当多的services的时候碰到如下一个错误,
当前的endpoint配置
解决办法:
1.在service的app.config的<system.serviceModel>节电下创建一个新的bindings, 使用netTcpBinding来代替mexTcpBinding:
2.将之前的endpoint设置改成
3.修改Client端的app.config 或者在"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE" 下的devenv.exe.config(修改这个的话需要重启VS)中添加.
添加
Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:9997/DataService/mex'.There is an error in the XML document.There is an error in the XML document.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.If the service is defined in the current solution, try building the solution and adding the service reference again.
当前的endpoint配置
<service behaviorConfiguration="MyBehavior" name="XXX.XXXX.DataService"> <endpoint address="" binding="netTcpBinding" name="NetTcpEndPoint" contract="XXX.XXXX.XXXXXXX.XXXX.XXXXXXXXXXXXXX.IDataService"/> <endpoint address="mex" binding="mexTcpBinding" name="NetTcpMetadataPoint" contract="IMetadataExchange"/> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:9997/DataService/"/> </baseAddresses> </host> </service>
解决办法:
1.在service的app.config的<system.serviceModel>节电下创建一个新的bindings, 使用netTcpBinding来代替mexTcpBinding:
<bindings> <netTcpBinding> <binding name="GenericBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> <security mode="None"/> </binding> </netTcpBinding></bindings>
2.将之前的endpoint设置改成
<service behaviorConfiguration="MyBehavior" name="XXX.XXXX.DataService"> <endpoint address="" binding="netTcpBinding" name="NetTcpEndPoint" bindingConfiguration="GenericBinding" contract="XXX.XXXX.XXXXXXX.XXXX.XXXXXXXXXXXXXX.IDataService"/> <endpoint address="mex" binding="netTcpBinding" name="NetTcpMetadataPoint" bindingConfiguration="GenericBinding" contract="IMetadataExchange"/> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:9997/DataService/"/> </baseAddresses> </host> </service>
3.修改Client端的app.config 或者在"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE" 下的devenv.exe.config(修改这个的话需要重启VS)中添加.
添加
<system.serviceModel> <bindings> <netTcpBinding> <binding name="GenericBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="None" /> </binding> </netTcpBinding> </bindings> <client> <endpoint binding="netTcpBinding" bindingConfiguration="GenericBinding" contract="IMetadataExchange" name="net.tcp" /> </client> </system.serviceModel>
4.之后再重新Add Service References就正常了.
我的原文连接 http://www.markgoo.com/?p=73
- 解决WCF The maximum nametable character count quota (16384) has been exceeded while reading XML data问题
- The maximum string content length quota (8192) has been exceeded while reading XML data
- The maximum string content length quota (8192) has been exceeded while reading XML data
- 解决sybase备份错误The maximum number of site handlers, 10 has been exceeded
- Xml and the Nametable
- 解决“A problem has been encountered while loading the setup components. Canceling setup.”的问题
- 解决“A problem has been encountered while loading the setup components. Canceling setup.”的问题
- 解决“A problem has been encountered while loading the setup components. Canceling setup.”的问题
- Maximum message size quota for incoming messages (65536) has been exceeded.已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceive
- Maximum message size quota for incoming messages (65536) has been exceeded.已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceive
- java.lang.IllegalStateException: Parameter count exceeded allowed maximum错误解决
- 关于Canvas中的"The canvas has been tainted by cross-origin data"跨域问题
- An exception has been caught while processing the refactoring 'Delete'.
- The maximum recursion 100 has been exhausted before statement completion
- “Location of the Android SDK has not been set up in the preferences”问题的解决
- "Unable to get image data from canvas because the canvas has been tainted by cross-origin data"问题产生原
- Has the sum exceeded
- 解决arcscene 不能显示问题 The 3D Analyst extension has not been enabled
- 怎样把一个程序中的对话框资源和对话框类移植到另一个程序中
- 【精度问题】
- 手动在SUSE10下安装VCS
- 映美精LoadDeviceStateFromFile问题
- Android中级教程之----Log图文详解(Log.v,Log.d,Log.i,Log.w,Log.e)!
- 解决WCF The maximum nametable character count quota (16384) has been exceeded while reading XML data问题
- oracle认证:提高Oracle数据库缓存命中率
- VC++中如何彻底删除一个类
- 苹果开机启动参数说明
- 程序员面试100题之一:对称字符串的最大长度
- iphone开源网络编程cocoaasyncsocket
- Qt之QLCDNumber类
- C#技巧(1)
- DataGrid鼠标操作上下滑动