ServiceClient client = null; string endPointAddr = ConfigurationManager.AppSettings["endpointAddress"].ToString(); EndpointAddress endpointAddress = new EndpointAddress(endPointAddr); BasicHttpBinding binding = new BasicHttpBinding(); binding.MaxBufferPoolSize = 2147483647; binding.MaxBufferSize = 2147483647; binding.MaxReceivedMessageSize = 2147483647; TimeSpan timespan = new TimeSpan(0, 10, 0); binding.UseDefaultWebProxy = true; binding.ReaderQuotas.MaxArrayLength = 2147483647; binding.ReaderQuotas.MaxStringContentLength = 2147483647; binding.ReaderQuotas.MaxBytesPerRead = 2147483647; binding.ReaderQuotas.MaxNameTableCharCount = 2147483647; binding.TransferMode = TransferMode.Streamed; binding.SendTimeout = timespan; binding.ReceiveTimeout = timespan; binding.CloseTimeout = timespan; EndpointAddress endpoint = new EndpointAddress(new Uri(endPointAddr)); client = new ServiceClient(binding, endpoint); //System.Threading.Thread.Sleep(10000); if (client.State != CommunicationState.Opened) { if (client.State != CommunicationState.Opening) { client.Open(); } } return client;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)