我正在使用WCF Web Api 4.0框架,並且正在運行到maxReceivedMessageSize已超過65,000錯誤。C#WCF Web Api 4 MaxReceivedMessageSize
我已經更新了我的webconfig,看起來像這樣,但因爲我是uisng WCF Web Api,我認爲這不再被使用了,因爲我不再使用webHttpEndpoint?
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name=""
helpEnabled="true"
automaticFormatSelectionEnabled="true"
maxReceivedMessageSize="4194304" />
</webHttpEndpoint>
我在哪裏,在新的WCF網絡API指定MaxReceivedMessageSize?
我也嘗試了CustomHttpOperationHandlerFactory無濟於事:
public class CustomHttpOperationHandlerFactory: HttpOperationHandlerFactory
{
protected override System.Collections.ObjectModel.Collection<HttpOperationHandler> OnCreateRequestHandlers(System.ServiceModel.Description.ServiceEndpoint endpoint, HttpOperationDescription operation)
{
var binding = (HttpBinding)endpoint.Binding;
binding.MaxReceivedMessageSize = Int32.MaxValue;
return base.OnCreateRequestHandlers(endpoint, operation);
}
}
沒有帶之所以能得到這個與我的工作服務嗨 –
nextgenneo,你設法得到運行到現在你的代碼? – Dominik