EDN Admin
Well-known member
Through a WCF method (hosted in local IIS) we are posting data to a external website (HTTPS) using WebRequest.
However when a client make a call to the WCF service, while connecting to the externalwebsite through WebRequest we are getting the below error message:
Unable to connect to the remote server
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it xxx.xxx.xxx.xxx:443<br/>
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)<br/>
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)<br/>
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
From the same dev machine if I create a console app to post data to the same external url it works perfectly fine and returns a response message successfully.
Can anyone suggest why the post fails when it is called through the WCF service?
View the full article
However when a client make a call to the WCF service, while connecting to the externalwebsite through WebRequest we are getting the below error message:
Unable to connect to the remote server
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it xxx.xxx.xxx.xxx:443<br/>
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)<br/>
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)<br/>
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
From the same dev machine if I create a console app to post data to the same external url it works perfectly fine and returns a response message successfully.
Can anyone suggest why the post fails when it is called through the WCF service?
View the full article