[转]Webservice client timeout

本文转自:http://social.msdn.microsoft.com/Forums/vstudio/en-us/ed89ae3c-e5f8-401b-bcc7-333579a9f0fe/webservice-client-timeout?forum=wcf

 

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编辑  收藏  举报

导航