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

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條評論
主站蜘蛛池模板: 婷婷综合社区 | 四虎影城| 国产精品亚洲成在人线 | 一区二区三区不卡在线 | 男人你懂的网站 | 天天尻| 国产精品久久久久久久久免费观看 | 中国在线播放精品区 | 亚洲欧美在线观看91偷拍 | 91热在线观看精品 | 国产欧美精品一区二区三区–老狼 | 日韩色视频一区二区三区亚洲 | 一区二区三区在线免费 | 亚洲五月激情 | 黄色毛片视频免费 | 亚洲国产成人在线观看 | 2020国产精品视频 | 一级毛片秋霞特色大片 | 亚洲精品动漫3d一区二区 | 亚洲精品中文一区不卡 | 日日操天天 | 天天操免费视频 | 99久久99热精品免费观看国产 | 天天操夜夜噜 | 九九精品激情在线视频 | 免费日本黄色网址 | 国产欧美日韩成人 | 日韩欧美一区在线观看 | 亚洲精品久久九九热 | 久久青草国产精品一区 | 操美女的视频网站 | 亚洲精品在线免费看 | 亚洲国产精品久久久久网站 | 亚洲美女性生活视频 | 国产免费资源 | 欧美久久综合九色综合 | 中文线码中文高清播放中 | 波多野结衣中文无毒不卡 | 免费激情片 | 国产亚洲精品网站 | 天天色综合5 |