I need your help regarding PayPal code integration with my asp.net/c# on PayPal Sandbox, I am using PayPal IPN and the code is same as provided by PayPal. I am working on local host. Payment has gone fine on PayPal and I have received the amount on my PayPal Sandbox account but when PayPal redirects it to my website page it shows me the following exception:
"Unable to connect to the remote serverSystem.Net.Sockets.SocketException (0x80004005): 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 192.168.10.9:8080 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() ".
I will really appreciate your help!
Related
So I recently bought a vps to try SignalR in my project, I used this example : Simple SignalR Project
Unfortunately though I do not have any experience with such things, I uploaded the ServerSide program on my vps and tried to connect with it, but I get the following error : An error occurred while sending the request.
More Detailed :
System.Net.Http.HttpRequestException' in mscorlib.dll
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 ip:9080
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) / System.Net.Sockets.SocketException (0x80004005): 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 ip:9080
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
So I was wondering if I'm doing anything wrong here, or need to do any specific settings/setups on my server
by the way my goal is to have a connection with a server and get real-time data for my project, so if there's any better alternatives, would appreciate suggestions
well, found the solution, my firewall was preventing the connection
I am trying to publish a bot that I coded in C# through visual studio 2015 on to AWS. I installed the Amazon Cloud SDK and was able to successfully publish the bot to AWS. I updated the bot endpoint with the address it gave (http://benbot-dev.us-west-2.elasticbeanstalk.com/). But when I go to Microsoft Bots site and test the bot connection it says Unable to connect to the remote server. Please help. I am thinking it is the https endpoint issue. But I am not sure how to get an API Gateway endpoint, if I should.
<<<<<<<<<<
500 InternalServerError
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> 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 52.42.245.162:443
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Intercom.DevPortal.Server.Controllers.BotManagerController.<PingV3BotAsync>d__54.MoveNext() in C:\a\1\s\DevPortalLib\Controllers\BotManagerController.cs:line 1420
>>>>>>>>>>>>>>>>
This exception message tells you that within your server code you are trying to reach server at 52.42.245.162, and this server is inaccessible (more specifically, https port 443 is inaccessible). This IP resolves to some AWS host (use nslookup command to find this out, see this answer). You can try to ping this IP, or try to see if port 80 is accessible (both are not from my host). Or you can try to enumerate if any other ports are open on that host (search google/bing for instructions how to do that). If you can't reach that port from your host, Microsoft Bots site can't reach it either. If your service is running on that IP, the most probably cause is that you have to open the port on AWS to be accessible from public internet (search google/bing for aws open port or aws allow ssh)
I have a windows service using C#(windows application) which performs a set of various functions.
But recently it was required to use a wsdl service (a url was provided) whose functions I have to use in my code.
Although I have never done it before but if I am not wrong we add the service reference creates its instance and then call its function.
I have done all these successfully.
But when i execute the service I get end point not found exception something like as below..
System.ServiceModel.EndpointNotFoundException: Could not connect to http://localhost:8082/quali-jaxrpc/quali. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8082. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8082
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
--- End of inner exception stack trace ---
The problem is that the service is already running on the server itself but yet it is giving this exception..
Am I doing something wrong?
Please note that my service is not WCF its windows service.
When I added the service reference of the WSDL in appconfig following was created-
<endpoint address="http://localhost:8082/qualicision-jaxrpc/qualicision"
So i just replaced the localhost with the IP of the server.
Although the service is deployed on the server and windows service also running on same but still adding actual IP of the server in place of localhost worked.
I'm developing a windows service, that downloads images from a specific URL. The service runs correctly on my computer but when I install it in the server it does not download the image and it gives the following error:
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 212.100.220.117:80
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadData(Uri address)
at System.Net.WebClient.DownloadData(String address)
What might be causing the error and how can I resolve it?
I read this page:
http://support.microsoft.com/kb/318140
I'm not sure if this is the problem, and if it is what proxy should I write in the config. Asking you for your advice.
I found the answer. I was trying to access the public address "http://mywebsite.com/images/" from the server. Instead of that I used the local IP of the server hosted the website and it's now working.
In this case it might be possible that port 80 is not open. Create an inbound and outbound rule in firewall setting to open port 80. Still, if the issue exists try with disabling the antivirus, It might be possible that antivirus is blocking the port.
In my case I had to modify the Logon settings of the Windows Service in the Windows Service console then used domain administrator account to run the service instead of the regular Local System/Service account then It started working properly.
If you are working, this could indicate that you aren't connected to your VPN.
I have a client application that uses WebHttpRequest to get response from external server, it works fine but some times I'm getting the following exception ....
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
xx.xx.xxx.xxx:xxx at
System.Net.Sockets.Socket.DoConnect(EndPoint
endPointSnapshot, SocketAddress
socketAddress) at
System.Net.Sockets.Socket.InternalConnect(EndPoint
remoteEP) at
System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6,
Socket& socket, IPAddress& address,
ConnectSocketState state, IAsyncResult
asyncResult, Int32 timeout, Exception&
exception) --- End of inner
exception stack trace ---
at
System.Net.HttpWebRequest.GetRequestStream(TransportContext&
context)
at
System.Net.HttpWebRequest.GetRequestStream()
.... Any help?
This is more of a "Request Timed Out" error. The server you are trying to connect to did not respond to your request. You should handle this exception using try-catch and attempt to connect n number of times again in the catch block.