1
我有我的WCF服務託管在Windows服務。客戶端應用程序是我添加服務引用的網站項目。現在WCF服務 - MaxReceivedMessageSize錯誤
,Windows服務配置文件有正確的設置MaxReceivedMessageSize:
<netTcpBinding>
<binding name="netTcp" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000">
<readerQuotas maxDepth="500" maxStringContentLength="50000000" maxArrayLength="50000000"
maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<security mode="None"></security>
</binding>
</netTcpBinding>
但是當我添加服務引用到網站項目,它更新使用默認值web.config中。然後我收到此錯誤: 傳入消息的最大消息大小配額(65536)已被超出。要增加配額,請在適當的綁定元素上使用MaxReceivedMessageSize屬性。
我認爲,使用service congig中的設置更新網站配置文件將解決此錯誤。
但是我不知道是否需要每次添加服務引用時手動更改這些設置?
僅供參考,您可能還需要增加'MaxBufferSize'。 – 2011-06-04 10:26:14