WCF - How to Increase Message Size Quota

后端 未结 13 1817
失恋的感觉
失恋的感觉 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:08

    You'll want something like this to increase the message size quotas, in the App.config or Web.config file:

    
        
            
                
            
        
    
    

    And use the binding name in your endpoint configuration e.g.

    ...
    bindingConfiguration="basicHttp"
    ...
    

    The justification for the values is simple, they are sufficiently large to accommodate most messages. You can tune that number to fit your needs. The low default value is basically there to prevent DOS type attacks. Making it 20000000 would allow for a distributed DOS attack to be effective, the default size of 64k would require a very large number of clients to overpower most servers these days.

提交回复
热议问题