Tôi đang sử dụng khuôn khổ WCF Web Api 4.0 và đang chạy vào maxReceivedMessageSize đã vượt quá 65.000 lỗi.C# WCF Web Api 4 MaxReceivedMessageSize
Tôi đã cập nhật webconfig của mình trông như thế này nhưng vì tôi đang sử dụng Web Api WCF, tôi nghĩ rằng điều này thậm chí không còn được sử dụng nữa vì tôi không còn sử dụng webHttpEndpoint nữa?
<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>
Tôi chỉ định MaxReceivedMessageSize trong WCF Web Api mới ở đâu?
Tôi cũng đã thử một CustomHttpOperationHandlerFactory vô ích:
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);
}
}
không thể làm việc này với dịch vụ của mình –
Xin chào nextgenneo, bạn có quản lý để chạy mã cho đến bây giờ không? – Dominik