Im making a request to a third party API using a service generated in Visual Studio, however I keep getting timed out incorrectly. The below error message was received when the service endpoint was configured as such:
_client.Endpoint.Binding.ReceiveTimeout = new TimeSpan(23, 0, 0, 0);
_client.Endpoint.Binding.OpenTimeout = new TimeSpan(23, 0, 0, 0);
_client.Endpoint.Binding.CloseTimeout = new TimeSpan(23, 0, 0, 0);
_client.Endpoint.Binding.SendTimeout = new TimeSpan(23, 0, 0, 0);
_client.InnerChannel.OperationTimeout = new TimeSpan(23, 0, 0, 0);
The request channel timed out while waiting for a reply after 22.23:59:09.8753653. 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.
I’ve set it to 23 days as an extreme for testing, but from the error, it looks as though the request is treating the days value as a seconds value, i.e timing out after 23 seconds, not 23 days.
I’m hoping this is just a configuration issue and not a bug?
Endpoint is type System.ServiceModel.Description.ServiceEndpoint
.NET7