需要一些關於如何看待進一步相關的WCF錯誤我得到關於請求實體太大(錯誤413)。WCF服務錯誤413實體太大
非常多,該服務是一個簡單的[OperationContract]接受字符串作爲參數。
<IService.cs>
[OperationContract]
string UploadReportText(string ReportText);
<Service.cs>
public string UploadReportText(string ReportText)
{
// Code to process data passed.
}
我已經設置web配置的服務如下:
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>
雖然我相信在IIS中uploadReadAhead值不需要被感動(因爲我沒有使用SSL),我還修改了它有2147483647
跟蹤調用Chrome的服務的應用程序的一個價值,我可以看到數據內容長度是169786.
真的難倒wher e看起來更進一步與此相關。
感謝任何見解。謝謝
更新: 附加信息 如果我將傳遞給服務的字符串數據設置爲更小的長度,我沒有收到錯誤。我所做的大部分搜索都與maxReceivedMessageSize有關,都需要調整到最大可能值,但將其設置在web配置中似乎沒有任何作用。
更新: 啓用日誌記錄,我得到這個消息:
異常詳細信息:System.ServiceModel.ProtocolException: 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.
綁定配置=「LargeSizeMessages」的伎倆嘗試了許多解決方案 – smoothumut