Questions tagged [system.net.webexception]

system.net.webexception is a .NET exception is thrown when an error occurs while accessing the network through a pluggable protocol.

system.net.webexception is a .NET exception is thrown when an error occurs while accessing the network through a pluggable protocol.

174 questions
0
votes
0 answers

WebException not caught when connection times out

I'm trying to catch WebException with certain Status inside IsTransient method, but it never catches the following error: System.Net.WebException: Unable to read data from the transport connection: Connection timed out. ---> System.IO.IOException:…
0
votes
1 answer

Is it okay to catch exception and then cast it to a specific one?

With this code I get the response (error code and message) when an exception from type WebException gets catched. Dim castExceptionToWebException As WebException = TryCast(ex, WebException) using r As new…
AdelP
  • 1
  • 2
0
votes
1 answer

Get JSON response from WebException

I have tried the below answer, but all I get is an empty string. WebException how to get whole response with a body? I have tested hitting the endpoint through postman, and I get the json response (error response) as I expect. But when I try and hit…
cphilpot
  • 1,155
  • 3
  • 17
  • 39
0
votes
1 answer

Polly show dialog after retry count reached

I'm using Polly to retry web service calls in case the call fails with WebException, because I want to make sure the method executed correctly before proceeding. However sometimes web methods still throw exception even after retrying several times…
0
votes
0 answers

Xamarin.Android handling connection failures when calling web service

We're developing warehouse app for picking items which sends requests to a web service on every item scan, e. g. to update the quantity scanned in DB. From the log files I saw thet every now and then the connection on android scanners is lost and…
0
votes
1 answer

Can get process ID from exception?

Attempting to deploy updates to a .dll using WebClient.DownloadFile. If the dll is loaded/locked by the program it cannot be overwritten, so i'm trying to use a Try... Catch statement (on the following exception) to curate the Process ID and…
Lee MC
  • 89
  • 5
0
votes
1 answer

What is the best way to download image from url in Xamarin ios?

I need to download Open street map tile for every panning and pinch zooming. I have used WebClient for downloading image from Uri. But I am getting “An HttpWebRequest was added to the connection group queue because the connection linit was reached…
Devi M
  • 39
  • 5
0
votes
1 answer

(HttpWebResponse)request.GetResponse() throwing The operation has timed out

I am trying to post my data using HTTPWebRequest to third party WebAPI. My data gets posted successfully, however in my error log I see a log saying The operation has timed out in (HttpWebResponse)request.GetResponse(). I am unable to find out why…
0
votes
1 answer

Cannot create SSL/TLS connection in vb when trying to obtain IPv4 address

I am writing a program in my computer science class and I have come across an error when trying to obtain the public IPv4 address of the computer. This is my code: Private Function GetMyIP() As Net.IPAddress Using wc As New Net.WebClient …
IsaSca
  • 23
  • 9
0
votes
1 answer

WebException - Blocking For Each Loop

I am learning to code since a few months. Today I want to code a password manager. Everything works fine but the get icon function has problem if a host is unreachable. This function is to get the favicon from the webpage. Try …
Der King
  • 21
  • 4
0
votes
3 answers

GetResponse() and WebException kill my thread

I'm actually facing an issue with a httpWebResponse that stop my thread. I call an ApiCall method in a looping thread every 2 seconds. This works most of the time. But sometimes the request.GetResponse() throws a WebException and stops my main…
0
votes
1 answer

FireBase throwing WebException 400 after first round of loop

As briefly described in the title im trying to add around 9400 items into the realtime-database and am therefore looping through my JArray for 500 items each call with a delay of 90sec between each call. While it totally works fine the first time,…
0
votes
1 answer

In windows phone 7, How to download the Google translate mp3 from site "http://translate.google.com/translate_tts?tl=en&q=hello+world"?

How to download the Google translate mp3 from site "http://translate.google.com/translate_tts?tl=en&q=hello+world"? I'm using the following code: WebClient wc = new WebClient(); wc.Encoding = Encoding.UTF8; …
0
votes
1 answer

Periodic timeouts when using HttpWebRequest

I have some code that send a simple xml web request. It is called from a windows service. Sometimes the service starts throwing exceptions (System.Net.WebException: The operation has timed out) and a restart of the service fixes the issue. Here is…
Paul Hiles
  • 9,558
  • 7
  • 51
  • 76
0
votes
2 answers

Which WebException Status Code To Use?

I have a c# application that sends requests to several API's, but earlier today one of them seemed to be down for a while and caused an exception within my exception handler: catch (WebException e) { var statusCode =…
Alec Gordon
  • 325
  • 4
  • 10