我正在使用Silverlight 2.0从.NET 2.0 Web服务中读取。 Web服务在30秒后请求超时,这对于大多数查询都是可以的,但偶尔会出现超时。如何将超时延长到一分钟?
我试过了,但没有区别。
SilverSearchSoapClient client = new SilverSearchSoapClient();
client.Endpoint.Address = new EndpointAddress(App.ServiceEndpointUrl);
client.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 1, 0);
client.Endpoint.Binding.SendTimeout = new TimeSpan(0, 1, 0);
client.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 1, 0);
return client;
答案 0 :(得分:8)
client.InnerChannel.OperationTimeout = new TimeSpan(0, 1, 0);