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
2
votes
1 answer

How do you create a WebException with a custom WebResponse

I have created a RESTful web service using MVC4 Web API. I am throwing a WebException if something is wrong. throw new WebException("Account not found"); Here's the client code that handles the exception: private void…
2
votes
1 answer

FtpWebRequest WebException: "Unable to connect to the remote server"

I have code in a Windows Service that successfully connects to an FTP server when I run it locally through a test harness (with the FTP server being on another machine on the local network). When I install it in the production hosting environment,…
Owen Blacker
  • 4,117
  • 2
  • 33
  • 70
2
votes
1 answer

Consistent FTP timeout in a scheduled windows service

I am having problem with ftp, in a windows service. I have scheduled a job to sent files through the ftp. Once in a while i'm having timeout (frequency once a week or maybe once a month), and it continues till i restart my windows…
Florjon
  • 3,569
  • 3
  • 22
  • 29
1
vote
4 answers

Streamwriter writes but gives web exception

I am trying to insert data via web service. The code below writes to the database; however, I have an error (see bottom). What goes wrong here? and how to fix it? //Create the web request HttpWebRequest request =…
Milton
1
vote
1 answer

Web request error/Web Exception

I am trying to get pdf file data using webclient but it is throwing an exception of "The remote server returned an error: (404) Not Found." Here are error details: System.Net.WebException was caught Message=The remote server returned an error:…
User0000
  • 11
  • 3
1
vote
2 answers

SmtpException from WebException: Unable to connect to the remote server

I am trying to send mail using smtp server but i am getting following Exception. Please give me some advice.. System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server --->…
ujas patel
  • 101
  • 1
  • 3
  • 7
1
vote
5 answers

Getting '(400) Bad Request' with GetResponseStream() in C#

I am using the following code to send a get request to facebook graph api oauth server. public string GetAccessToken(string code) { HttpWebRequest req = (HttpWebRequest)…
1
vote
1 answer

Http.WinHttpException sent on SOAP request .NET CORE 2.2. The message received was unexpected or badly formatted

We have three IHostedService in our .NETCore2.0 webapp performing operations periodically. Two of them are in polling on an external system asking for new data; the third sends to the same external system some data gathered by our webapp. Every…
1
vote
1 answer

my code has error System.Net.WebException: 'An exception occurred during a WebClient request.'

my xamarin code has System.Net.WebException: 'An exception occurred during a WebClient request.' error NameValueCollection postCollection = new NameValueCollection(); postCollection.Add("q", city); postCollection.Add("appid", ApiKey); WebClient…
1
vote
1 answer

System.Net.WebException : POST Failed while UiTesting on local emulator

I am trying to verify that the UI elements of my LoginPage work as expected. The test is supposed to write a user name, user password and server adress into the corresponding entry fields then tap the sign in button. The UITest loads the LoginPage…
PhilippH
  • 11
  • 2
1
vote
1 answer

C# webrequests->getresponse casts exception instead of returning status code

I'm attempting to make an image scraper, now for some pages the image was not specified so i wanted to parse my output based on the status code i receive when accessing the page but when i attempt to pare my status code i get an exception instead of…
user14187399
1
vote
1 answer

Politely checking to see if a file exists before downloading

I'm trying to download files using the Net.WebClient call to DownloadFile Using client As New Net.WebClient() Try client.DownloadFile(PDFURL, FullPDFFilePath) I then catch the exception and check the message for 403, 404, or 500 errors…
cometbill
  • 1,619
  • 7
  • 19
  • 41
1
vote
0 answers

System.Net.WebException: Error: TrustFailure (A call to SSPI failed, see inner exception.)

Getting following error in xamarin: System.Net.WebException: Error: TrustFailure (A call to SSPI failed, see inner exception.) Below is my code: UserRepository usr = new UserRepository(); var restClient = usr.RestClient; …
1
vote
1 answer

How to get an Exception from another class c#

i have these class //Class 1, ViewModel public async System.Threading.Tasks.Task ExecuteSystemObject(string parameters) { ... dynamic j = await ExternalProject.ExecuteSomething(parameters); //How…
El0din
  • 3,208
  • 3
  • 20
  • 31
1
vote
0 answers

How to debug dotnet core program terminating with uncaught exception of type PAL_SEHException

I'm testing how my dotnet core application behaves on no internet connection. The program always crash with libc++abi.dylib: terminating with uncaught exception of type PAL_SEHException I tried to find what command is triggering it but could not…
Mugen
  • 8,301
  • 10
  • 62
  • 140