[转]Webservice client timeout
After creating proxy object do this :
client.InnerChannel.OperationTimeout = new TimeSpan(0,10,0);
--------------------------------------------
Please find the code below: ReportPortClient client = new ReportPortClient("Report"); client.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 6, 0); client.Endpoint.Binding.CloseTimeout = new TimeSpan(0, 6, 0); client.Endpoint.Binding.SendTimeout = new TimeSpan(0, 6, 0); client.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 6, 0); client.ClientCredentials.UserName.UserName =strUserName; client.ClientCredentials.UserName.Password = strPassword; client.Endpoint.Address = new System.ServiceModel.EndpointAddress(strURL);
posted on 2014-02-25 10:26 freeliver54 阅读(654) 评论(0) 编辑 收藏 举报