I am using the HttpURLConnection class to connect to external web service from eclipse, then I am getting a error message \"Connection Refused\"
public class Tes
Please find the working code,
PROXY_SERVER set to a valid proxy server and port for http I am using is 8080
proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(PROXY_SERVER, PROXY_PORT));
And when you establish the connection pass the proxy as an argument.
urlConnection = (HttpURLConnection) ((new URL(URI).openConnection(proxy)));