WebService出錯 Maximum message size quota for incoming messages (65536) has been exceeded.已超過傳入訊息(65536)的最大訊息大小配額

來源:互聯網
上載者:User

標籤:arch   int   height   tab   lex   hostname   car   asm   方法   

轉自海樂學習原文WebService出錯 Maximum message size quota for incoming messages (65536) has been exceeded.已超過傳入訊息(65536)的最大訊息大小配額

 

 問題1:WebService出錯 Maximum message size quota for incoming messages (65536) has been exceeded.

今天下午在網上一直搜尋解決方案將近2個小時,人要崩潰了,除了StackOverflow上的洋文有些資訊外,國內幾乎不見蹤影。十分苦惱,英語看起來十分費勁,也沒有給出直接的解決方案。後來在看到了海樂學習的一篇文章,先將其整理過來,以饗讀者。

問題的根本原因正如錯誤異常說明的那樣,起始方法上面也說了,只是對於新人來說,你根本不知道在哪裡進行設定。其實就是在app.config中的下面,設定一下請求的一些參數的數值。

這樣一來,就擺脫了預設參數的請求大小的設定,而可以請求較大的包了。設定的方框中的內容在下面的程式碼片段中,你們拷貝一下就好了(注意只拷貝方框中的內容,同時注意修改橢圓中的值,使得其前後一致)。

<system.serviceModel>    <bindings>      <basicHttpBinding>        <binding name="ServerUpdaterSoap" closeTimeout="00:01:00"          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"          maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"          useDefaultWebProxy="true">          <readerQuotas maxDepth="64" maxStringContentLength="8192000" maxArrayLength="16384000"            maxBytesPerRead="4096000" maxNameTableCharCount="16384000" />          <security mode="None">            <transport clientCredentialType="None" proxyCredentialType="None"              realm="" />            <message clientCredentialType="UserName" algorithmSuite="Default" />          </security>        </binding>      </basicHttpBinding>    </bindings>    <client>      <endpoint address="http://localhost:3604/ServerUpdater.asmx"          binding="basicHttpBinding" bindingConfiguration="ServerUpdaterSoap"          contract="WebReferenceUpdater.ServerUpdaterSoap" name="ServerUpdaterSoap" />    </client>  </system.serviceModel></configuration>
View Code

 

2:讀取 XML 資料時,超出最大字串內容長度配額 (8192)。通過更改在建立 XML 讀取器時所使用的 XmlDictionaryReaderQuotas 對象的 MaxStringContentLength 屬性,可增加此配額。 第 211 行,位置為 394。

解決辦法:

也是修改Web.Config中的MaxStringContentLength ,這是有些資料比較長的時候出現這個問題,改大一點就可以了吧。

<readerQuotas maxDepth="64" maxStringContentLength="8192000" maxArrayLength="16384000"
            maxBytesPerRead="4096000" maxNameTableCharCount="16384000" />

 

WebService出錯 Maximum message size quota for incoming messages (65536) has been exceeded.已超過傳入訊息(65536)的最大訊息大小配額

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.