简体   繁体   中英

WCF service timeout setting

I have a ASP.NET 4.0 app that is calling a WCF service. For testing, the closeTimeout, openTimeout, receiveTimeout, and sendTimeout values in the wsHttpBinding binding are all set to 01:00:00.

When I ran a test in which the service took 5 minutes 40 seconds, I could see the correct results of the WCF service in the app event log. However, the app did not process the results.

In subsequent identical tests in which the WCF service took less than 4 minutes, I could see the same correct results in the app event log, but the app processed the results correctly.

I'm thinking there's another timeout setting I don't know about. Any ideas? Thanks.

Try the OperationTimeout property of the WCF service client where it is instantiated:

MyWCFServiceClient client = new MyWCFServiceClient();
client.InnerChannel.OperationTimeout = new TimeSpan(0, 10, 0);
client.Open();

The above will set the timeout to 10 minutes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM