Question

I have a WCf service which calls an external restfull service. I have deployed WCF service in windows service environment and i am able to run windows service locally and it worked fine, but when i deploy service in windows server. It gives below 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 174.143.127.78:443 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.GetResponse()

Is there anything that needs to be configured on server? Any clue why it worked locally but not on server

No correct solution

OTHER TIPS

OK, the key information in your error message is "connection attempt failed", which tells us that your client never reached the host and then timed out.

So the first thing I'd check is the firewall settings on the host. Your URL (listed in your error message) says you're trying to reach the service on 443 (normally for SSL). Make sure your server has that port open for in and out traffic. BTW, even if you're using SSL in your communication, you don't need to use 443 as your port. You can use any port you want within the range allowed.

If that doesn't work, I'd get a copy of Fiddler running on my client and try again, letting Fiddler act as a middleman proxy to capture and log the information going back and forth. That's usually a good way to debug WCF communication problems.

Also, the easiest way to check whether a web service is reachable is to simply type the URL (format is: http: //servername:port/ServiceName/ServiceMethod) into any browser address bar and hit enter. Doing that will contact the web service and, if you get a WSDL message back, you know you have the right address and that communication can commence.

Good luck. If this answers the question, don't forget to mark it as such.

The server where your service is hosted is trying to communicate with 174.143.127.78:443. That's probably where your RESTful service is deployed. You will have to work with your IT to open ports on these boxes so they can communicate with each other. If that can't be done, try seeing if you can host both your services on the same box.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top