我正在使用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