.Net Core 2.0 timeout for WCF web service in c#

1.3k Views Asked by At

I am doing a .NET Core 2.0 App. I am calling a webService. I added a Reference to a local Service and call it from my Application.

 ServiceReference1.QueryCalendarClient  servicio = null;
                ServiceReference1.ListCalendarDayTypeRequest request = new ServiceReference1.ListCalendarDayTypeRequest();
                ServiceReference1.ListCalendarDayTypeResponse response = null;

                var binding = new BasicHttpBinding();
                binding.ReceiveTimeout = new TimeSpan(0, 25, 0);
                binding.SendTimeout = new TimeSpan(0, 25, 0);
                binding.MaxBufferSize = 2147483647;
                binding.MaxReceivedMessageSize = 2147483647;
                binding.Security = new BasicHttpSecurity
                {
                    Mode = BasicHttpSecurityMode.TransportCredentialOnly,
                    Transport = new HttpTransportSecurity()
                    {
                        ClientCredentialType = HttpClientCredentialType.Basic
                    }
                };
                servicio = new ServiceReference1.QueryCalendarClient(binding, new EndpointAddress("http://WebBasica?wsdl"));
               
                servicio.ClientCredentials.UserName.Password = "123456789";
                servicio.ClientCredentials.UserName.UserName = "user";

 response = new ServiceReference1.ListCalendarDayTypeResponse();
            response = servicio.Method(request.CalendarInquireRequest_MT).Result;

I have an time Out Exception.

The request channel timed out while waiting for a reply after 00:24:58.3211575. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

Any timeOut I set, gave me a TimeOut error...

Where can I set the time out?

What I am missing?

Thank

0

There are 0 best solutions below