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

how to handle WebException in ASP.Net Web Application using c#?

I'm creating my own weather api by calling third party api openweather. I don't know how to handle WebException which occurs when I provide city which doesn't exist as an input, it gives me status code 404 from openweatherapi and I don't know how to…
Holasmabre
  • 82
  • 5
0
votes
0 answers

System.Net.Http different behaviour in Windows Service and Console apps

I am trying to create Windows Service which do HTTP requests on a timer. After deploying application in production I have noticed that certain endpoint cannot receive data. After manual inspection I certainly know that I can ping, do POST request to…
0
votes
1 answer

Timeout: WebException when trying to access/debug LocalHost of Azure Functions [Unity] [PlayFab]

I'm trying to debug Azure Function scripts locally, in conjunction with Unity, but getting Timeout errors every time. I have a few things here, and I'm not sure which one is actually causing the problem... It might be a settings on Windows, as…
0
votes
1 answer

What does WebException Error: Success mean and How to Troubleshoot?

I'm completely at a loss here. The code itself usually works. Every once in a while I end up with this rather cryptic "Success" error instead, however. Rebooting seemed to help once, but now even that doesn't seem to work. I have no idea how to get…
CodeMonkey
  • 1,795
  • 3
  • 16
  • 46
0
votes
0 answers

Exchange EWS closes connection when accessing with C# Microsoft.Exchange.Webservices.dll

We are running a C# routine who retrieves emails from Exchange public folders. After migration from Exchange 2016 to 2019 we encounter a network problem: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on…
devGeek
  • 59
  • 3
  • 8
0
votes
1 answer

system.net.webexception:error on the remote server: (400) bad request

I've created a wcf webservice that has a login method. this is my code: IService1.cs [ServiceContract] public interface IService1 { [OperationContract] [WebInvoke( BodyStyle = WebMessageBodyStyle.Wrapped,ResponseFormat…
rana hd
  • 355
  • 3
  • 18
0
votes
0 answers

HttpWebResponse with multiple URL causes error

I have this code: public class WebDataDownloader { public string GetJSONFromURL(string url) { string file = string.empty; //*********get the json file using httpRequest *********** try { …
0
votes
1 answer

System.Net.WebException: 'The underlying connection was closed: An unexpected error occurred on a receive.'

Can somebody please help me with the below code. I have a function where I am trying to get some data from a website using the URL "https://www1.nseindia.com/live_market/dynaContent/live_analysis/pre_open/all.json". But for some reason I am always…
user1891411
  • 3
  • 1
  • 3
0
votes
1 answer

Error when trying Stream.Write several times in C# net 4.0

string CRLF = "\r\n"; string boundary = "--" + DateTime.Now.Ticks.ToString("x") + "--"; byte[] boundaryBytes = System.Text.Encoding.ASCII.GetBytes(CRLF + boundary + CRLF); string content_Type = "multipart/form; boundary=" + boundary…
Bellhoon
  • 13
  • 4
0
votes
0 answers

WebRequest.GetResponse() throws timeout exception even after setting timeout and the program waiting for the set duration

I try to get response codes from links which I extract from an email. I use the System.Net lib to accomplish the response code extraction. While debugging and testing my code I ran into the System.Net.WebException "The operation has timed out" …
JieBaef
  • 122
  • 1
  • 11
0
votes
1 answer

404 error while getting server response vb.net

I'm a totally beginner with webrequest, so I have no idea about what cause the error I get. I try to login on a form following the microsoft tutorial for webrequest, but when I want to get the server response, I have the following error : "the…
Gary F
  • 59
  • 2
  • 7
0
votes
1 answer

C# Handle WebExceptions within DAL

Is there a way of correctly handling WebExceptions within a Data Access Layer? Below is a method SendReceive within our DAL used to communicate with our remote server, if there is a communication issue, such as endpoint being inaccessible and…
iggyweb
  • 2,373
  • 12
  • 47
  • 77
0
votes
1 answer

"Run as Administrator" (System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.)

I am getting the WebException error only on 2 PCs (i tryed 5 diferent PCs). The problem does not occure if i start application "As administrator". I have tryed to add ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol…
Martin86
  • 123
  • 1
  • 2
  • 19
0
votes
1 answer

The operation has timed out while reading xml file

I am getting the following error while I am reading an remote xml file to convert currency on HttpWebRequest.GetResponse() section. the method that I used TugberkUgurlu_CurConverter.ConverterClass.ConvertActionForTL() is reading an xml file and get…
tugberk
  • 57,477
  • 67
  • 243
  • 335
0
votes
1 answer

HttpWebRequest.GetResponse. Unable to establish a connection to the server

I am using HTTPWebRequest in c# to connect to a server in a .netStandard project. Code. byte[] buffer = Encoding.ASCII.GetBytes(data); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); // Send request request.Method =…
kkica
  • 4,034
  • 1
  • 20
  • 40