亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

WCF服務接口多,客戶端在引用時出錯!報WCF The

系統 1644 0

在服務端中定義接口太多時,在客戶端的服務引用時,報錯誤:

?元數據包含無法解析的引用:“net.tcp://localhost:8081/BaseData/mex”。??? XML 文檔中有錯誤。??? 讀取 XML 數據時,超出最大名稱表字符計數配額 (16384)。名稱表是用于存儲在處理 XML 時所遇到的字符串的數據結構 - 具有非重復元素、屬性名稱和屬性值的長 XML 文檔可能會觸發此配額。通過更改在創建 XML 讀取器時所使用的 XmlDictionaryReaderQuotas 對象的 ? MaxNameTableCharCount 屬性,可增加此配額。

解決方法:

服務端配置文件:

<system.serviceModel>
? ? <services>
? ? ? <!--基礎數據服務-->
? ? ? <service name="PmsWcfServer.PmsWcfBaseData" behaviorConfiguration="WcfBaseData">
? ? ? ? <host>
? ? ? ? ? <baseAddresses>
? ? ? ? ? ? <add baseAddress="net.tcp://127.0.0.1:8081"/>
? ? ? ? ? </baseAddresses>
? ? ? ? </host>
? ? ? ? <endpoint address="" binding="netTcpBinding" ?contract="PmsWcfServer.IPmsWcfBaseData" bindingConfiguration="BindBaseData"/>
? ? ? ? <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
? ? ? </service>
? ? </services>
? ? <behaviors>
? ? ? <serviceBehaviors>
? ? ? ? <behavior name="WcfBaseData">
? ? ? ? ? <serviceDebug includeExceptionDetailInFaults="true"/>
? ? ? ? ? <serviceMetadata httpGetEnabled="false"/>
? ? ? ? ? <serviceCredentials>
? ? ? ? ? ? <serviceCertificate x509FindType="FindBySubjectName" findValue="PmsWcfServer" storeLocation="LocalMachine"/>
? ? ? ? ? ? <userNameAuthentication userNamePasswordValidationMode="Custom" ?customUserNamePasswordValidatorType="PmsWcfServer.CheckUserNamePass,PmsWcfServer"/>
? ? ? ? ? </serviceCredentials>
? ? ? ? </behavior>
? ? ? </serviceBehaviors>
? ? ??
? ? ? <endpointBehaviors>
? ? ? ? <behavior name="BindBaseData">
? ? ? ? ? <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
? ? ? ? </behavior>
? ? ? </endpointBehaviors>
? ? </behaviors>
? ??
? ? <bindings>
? ? ? <netTcpBinding>
? ? ? ? <binding name="BindBaseData" maxReceivedMessageSize="2147483647">
? ? ? ? ? <security mode="Message">
? ? ? ? ? ? <message clientCredentialType="UserName"/>
? ? ? ? ? </security>

<!--注意:紅色字體,這里必須要修改 maxNameTableCharCount值,增大配額 -->?

? ? ? ? ? <readerQuotas maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxDepth="32000"/>
? ? ? ? </binding>
? ? ? </netTcpBinding>
? ? </bindings>
? </system.serviceModel>

? ? 只是修改以上配置文件,客戶端依然后引用不成功,還需要修改:C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config文件,在文件后面增加以下節:

? ?<system.serviceModel> ?
? ? <bindings> ?
? ? ? <netTcpBinding> ?
? ? ? ? <binding name=" BindSystem " 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=" BindSystem " ?
? ? ? ? contract="IMetadataExchange" name="net.tcp" /> ?
? ? </client> ?

? </system.serviceModel>?

重啟VS,后再次引用成功!?

?

?

?

WCF服務接口多,客戶端在引用時出錯!報WCF The maximum nametable character count quota (16384) has been exceeded while reading XML data錯誤


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 韩国爱情片免费大全 | 亚洲欧美综合区自拍另类 | 性做久久久久免费看 | 中文字幕一区二区视频 | 久久精品国产日本波多麻结衣 | 全午夜免费一级毛片 | 日韩在线看片中文字幕不卡 | 欧美一区二区三区不卡片 | 免费看成人频视在线视频 | 亚洲xoxo | 色爱区综合五月激情 | 久久久婷 | 成人动漫影院 | 五月色婷婷琪琪综合伊人 | 夜夜爱夜夜爽 | 精品无人区乱码1区2区3区在线 | 国产成人看片免费视频观看 | 国产精品久久久久久久免费大片 | 国产精品一区二区三区免费视频 | 亚洲swag精品自拍一区 | 久久国产视频网站 | 亚洲国产综合在线 | 午夜精品久久久久久久99热浪潮 | 免费黄色在线 | 深夜在线看| 99久热在线精品视频播 | 国产一级淫片a免费播放口欧美 | 黄色免费看网站 | 色综合久久中文 | 久久99热这里只有精品免费看 | 在线成人欧美 | 久草在线观看视频 | 99久久免费精品高清特色大片 | 欧美成人性做爰 | 久久久国产精品视频 | 午夜视频福利 | 国产高清看片日韩欧美久久 | 黄色在线观看视频免费 | 在线观看www成人影院 | 国产成人精品免费 | 欧美操穴视频 |