How to increase the timeout of a Invoke-WebRequest call either globally or in web.config?
If your program uses the now legacy API `System.Net.HttpWebRequest` and that `HttpWebRequest` throws a `System.Net.WebException` that reads `The operation has timed out`
Is it possible to change the timeout property in the System.Net.WebException via a web.config file by adding the correct add element name and value attribute?
Or possibly change it globally using the registry or a GPO?
I have already been advised to fix this using netsh http retries and some other settings and truth be told the issue could be on the opposite end of the connection where it also could be timing out; but it is unclear how to find that out.
The error looks like this:
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.WebServices.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
….
I am running a web-services based .NET application; it like most .NET web-based applications has an XML configuration file in which you can specify <add key=”some-keyname” value=”some-valuename” />.
After the application reaches out to the enterprise server with a webservices request; eventually it times out; but the error message does not make it clear if we are talking about a timeout that comes from the enterprise server end or if the timeout is coming from the client end on the machines that I work on and can control.
It simply says in a dialog box that pops up with a title that reads Error
(again, it doesn’t specify if the time out came from my end or the enterprise end)…and it goes on…with the rest of the stack trace to tell us where the exception came from:
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at EGatewayClientCE.EGatewayService.BDSWse.ProcessDimeRequest()
…etc
If your program uses the now legacy API `System.Net.HttpWebRequest` and that `HttpWebRequest` throws a `System.Net.WebException` that reads `The operation has timed out`Is it possible to change the timeout property in the System.Net.WebException via a web.config file by adding the correct add element name and value attribute?Or possibly change it globally using the registry or a GPO?I have already been advised to fix this using netsh http retries and some other settings and truth be told the issue could be on the opposite end of the connection where it also could be timing out; but it is unclear how to find that out.The error looks like this: System.Net.WebException: The operation has timed out.
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.WebServices.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
…. I am running a web-services based .NET application; it like most .NET web-based applications has an XML configuration file in which you can specify <add key=”some-keyname” value=”some-valuename” />.After the application reaches out to the enterprise server with a webservices request; eventually it times out; but the error message does not make it clear if we are talking about a timeout that comes from the enterprise server end or if the timeout is coming from the client end on the machines that I work on and can control.It simply says in a dialog box that pops up with a title that reads Error System.Net.WebException: The operation has timed out(again, it doesn’t specify if the time out came from my end or the enterprise end)…and it goes on…with the rest of the stack trace to tell us where the exception came from:at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at EGatewayClientCE.EGatewayService.BDSWse.ProcessDimeRequest()
…etc Read More