2

I have HttpWebRequest and its giving this error.I cannot try this answer because i cannot use local ip.There is a strange issue that in my computer there is no error like this but in the server its giving this error.The database is not in server we are using an api for crud operations.By the way the project is windows service. Its giving this error and then the service is stopping.there is another detail.The server where i install the windows service (its is not a server that has th database.) has %100 cpu usage and almost %100 ram usage.I set the timetout of request 100 seconds but it is not solve the problem.The detailed answer as below

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond....

How can i solve this ? And idea? By the way about 50 seconds program trying to post request and then giving the error.Also there is another detail the database owner api has get methods that lists some data i can open them from browser with same link that i used in post

Community
  • 1
  • 1
mr.
  • 679
  • 12
  • 30
  • Could you show some of the code you use in your Windows Service? It could be the firewall or a programming error in the server. Maybe the server cannot start the listener => check the EventLog in the Server to see any exceptions. There are many options, we need more information. – slfan Jun 13 '16 at 14:12
  • @slfan Other services running only inside the server not making any request working well. Also i changed the service to a console application it is waiting in using (var stream = request.GetRequestStream()) { stream.Write(data, 0, data.Length); } about 50 secs. But in my pc it is working well. I cannot understant anything in from eventlog of windows. Is there anyway to find meaningful log ? – mr. Jun 13 '16 at 14:39
  • to see the event log, just go into the start menu and type event viewer or right-click on Computer and select Manage.... Is your client a windows service or the server? The problem lies probably on the server or on the network, not in the client. – slfan Jun 13 '16 at 14:51
  • @slfan thanks for your interest and suggestions.The problem is about proxy settings of server. We solved this. Thanks again – mr. Jun 15 '16 at 11:25
  • I am having the same issue. – Aravin Jun 26 '16 at 18:29
  • How to solve this issue.? – Aravin Jun 26 '16 at 18:31

1 Answers1

0

The Problem is about proxy settings of httpwebrequest. Setting a proxy solved this.

mr.
  • 679
  • 12
  • 30