讀取 XML 數據時,超出最大字符串內容長度配額 (8192)


格式化程序嘗試對消息反序列化時引發異常: 嘗試對參數 http://www.thermo.com/informatics/xmlns/limswebservice 進行反序列化時出錯: ProcessResponse。InnerException 消息是“反序列化對象 屬於類型 DAL.ServiceReference1.ProcessResponseBody 時出現錯誤。讀取 XML 數據時,超出最大字符串內容長度配額 (8192)。通過更改在創建 XML 讀取器時所使用的 XmlDictionaryReaderQuotas 對象的 MaxStringContentLength 屬性,可增加此配額。 行 1,位置 10694。”。有關詳細信息,請參見 InnerException。

 

第一步在服務器配置文件添加添加如下

主要是

maxReceivedMessageSize與maxStringContentLength
<system.serviceModel>
下添加
<bindings>
<basicHttpBinding>
<binding name="Basicbindings" maxReceivedMessageSize="202400000">
<readerQuotas maxStringContentLength="2024000000"/>
</binding>
</basicHttpBinding>
</bindings>

  第二步在客戶端生成的配置文件修改

修改

maxReceivedMessageSize,maxBufferSize,maxStringContentLength三個值
 <binding name="BasicHttpBinding_TaoQuData" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="2024000000" maxBufferPoolSize="524288" maxReceivedMessageSize="2024000000"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="2024000000" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM