2011-12-09 55 views
1

即使我設置的所有值到2147483647如何解決「傳入消息的最大消息大小限額(65536)已被超出」WCF中的錯誤?

Client side : 

<binding name="BasicHttpBinding_IPortfolioBALService" 
     closeTimeout="00:10:00" openTimeout="00:01:00" 
     receiveTimeout="00:10:00" sendTimeout="00:10:00" 
     allowCookies="false" bypassProxyOnLocal="false" 
     hostNameComparisonMode="StrongWildcard" 
     maxBufferSize="2147483647" maxBufferPoolSize="2147483647" 
     maxReceivedMessageSize="2147483647" 
     messageEncoding="Text" textEncoding="utf-8" transferMode="Streamed" 
     useDefaultWebProxy="true"> 
      <readerQuotas 
       maxDepth="64" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
       maxNameTableCharCount="2147483647" /> 
      <security mode="None"> 

    Server side: 

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

我得到的錯誤。我想從數據庫中獲得168條記錄到列表中。但我得到這個錯誤。請告訴我在哪裏改變。

我收到error1,同時保存大小超過16KB的圖像。是否有任何改變以保存圖像。 錯誤1: 讀取XML數據時,超過了最大數組長度限額(16384)。可以通過更改創建XML閱讀器時使用的XmlDictionaryReaderQuotas對象的MaxArrayLength屬性來增加此配額。 1號線,位置34042.'。有關更多詳細信息,請參閱InnerException。

謝謝, Rakesh。

+0

你真的**使用**這個綁定配置?你是否在服務器和客戶端都這樣做? –

+0

是marc ...我得到了同樣的錯誤在保存圖像的大小超過16kB我沒有找到所需的解決方案。請幫助我。 – rakesh

+0

你可以發佈完整的WCF配置嗎(服務器和客戶端的'>內的任何東西? –

回答

2

您需要在服務器web.config和客戶端配置文件上爲MaxReceivedMessageSize,maxArrayLength,maxStringContentLength,maxBufferSize設置值。還要確保您的HttpRunTime元素具有maxRequestLength集。

+0

謝謝Rajesh ...它解決了我從數據庫獲取所有數據的要求,請告訴我如何通過WCF將大小超過16KB的圖像保存到數據庫中。 – rakesh

相關問題