我在網上瀏覽過,沒有任何解決方案對這個問題似乎適用於我。我有一個Silverlight應用程序正在使用WCF服務。一切工作正常,直到我嘗試更新大對象圖。我跟蹤日誌迎接我可愛的錯誤:WCF MaxReceivedMessageSize在web.config中更改時不會更新
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
我在我的兩個web.config文件,並在Silverlight的ClientConfig文件中更改設置,甚至試圖手動創建代理並設置在代碼中的值。
我的web.config:
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
<endToEndTracing propagateActivity="true" activityTracing="true"
messageFlowTracing="true" />
</diagnostics>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingSettings" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00"
maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="TestConfigService">
<endpoint address="" contract="PreferencesUI.Hub.PreferenceSVC.ITestConfig" binding="basicHttpBinding"
bindingConfiguration="basicHttpBindingSettings" />
</service>
</services>
</system.serviceModel>
我的Silverlight:
EndpointAddress ea = new EndpointAddress("http://localhost:37935/TestConfig.svc");
BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
binding.CloseTimeout = new TimeSpan(00, 5, 00);
binding.OpenTimeout = new TimeSpan(00, 5, 00);
binding.ReceiveTimeout = new TimeSpan(00, 5, 00);
binding.SendTimeout = new TimeSpan(00, 5, 00);
binding.TextEncoding = System.Text.Encoding.UTF8;
binding.MaxReceivedMessageSize = int.MaxValue;
binding.MaxBufferSize = int.MaxValue;
_preferenceTSTServiceProxy = new TSTC.TestConfigClient(binding, ea);
有誰看到我在這裏錯過了嗎?我在網上找到的所有東西都指出,有人忘記了設置maxReceivedMessageSize或忘記給端點一個bindingConfiguration名稱值(我已經完成了這兩個操作)。
basicHttpBinding沒有httpProtocol元素。將其更改爲customBinding以訪問該配置元素,但仍然沒有骰子。還是)感謝你的建議。 – user1072314