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

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條評論
主站蜘蛛池模板: 牛牛本精品99久久精品 | 国产国产成人人免费影院 | 日日干天天草 | 久久国产视屏 | 黄色片网站在线 | 欧美亚洲国产成人综合在线 | 天天爽夜夜爽精品视频一 | 亚洲 欧美 综合 | riav久久中文一区二区 | 国产五月色综合 | 14一15sexvideo日本 | 色综合天天综久久久噜噜噜久久〔 | 国产xxxx69免费大片 | 天天爱天天做久久天天狠狼 | 成人精品视频 | 91网红福利精品区一区二 | 九九热视频精品在线观看 | 国产精品短视频 | 免费观看黄a一级视频日本 免费观看黄色 | 夜夜操夜夜骑 | 伊人国产在线观看 | 国产又色又爽又黄又刺激18 | 伊人久久亚洲综合天堂 | 欧美精品一区二区精品久久 | 久久久久女人精品毛片九一 | 波多野结衣 一区二区 | 五月婷婷开心综合 | 一级毛片在线免费播放 | 国产视频日本 | 国产在线原创剧情麻豆 | 麻豆成人久久精品二区三区小说 | 亚洲精彩视频在线观看 | 国产精品99久久免费观看 | 欧洲欧美成人免费大片 | 国产成人精品日本亚洲网站 | 亚欧精品一区二区三区 | 亚洲综合伊人 | 日韩高清一区二区三区不卡 | 久久中文字幕在线观看 | 玖玖精品在线视频 | 国产乱码精品一区二区三上 |