Search code examples
asp.netwcfwcf-data-servicesodataasp.net-web-api

Setting timeout for WCF Dataservice


I was struggling with some timeouts for an OData service. My first idea was to change the timeout property but I could not find the correct place to do this. Where should be the request timeout set and how?, is there any best practice?.


Solution

  • If you are using the ODataClient (DataServiceContext), it has a Timeout property that one can set. If you are using your own client, then it depends on what technology you are using to send the request - HttpWebClient, HttpListener, HttpClient, etc. They all have properties to set appropriate Timeout.

    Hope this helps. Thanks Pratik