WCF - How to Increase Message Size Quota

后端 未结 13 2032
失恋的感觉
失恋的感觉 2020-11-22 06:16

I have a WCF Service which returns 1000 records from database to the client. I have an ASP.NET WCF client (I have added service reference in asp.net web application project

13条回答
  •  独厮守ぢ
    2020-11-22 07:03

    If you are creating your WCF bindings dynamically here's the code to use:

    BasicHttpBinding httpBinding = new BasicHttpBinding();
    httpBinding.MaxReceivedMessageSize = Int32.MaxValue;
    httpBinding.MaxBufferSize = Int32.MaxValue;
    // Commented next statement since it is not required
    // httpBinding.MaxBufferPoolSize = Int32.MaxValue;
    

提交回复
热议问题