I am trying to use a soothing web service in java using the Apache Wink framework through my web proxy requiring authentication
ClientConfig clientConfig = new ClientConfig(); clientConfig.proxyHost("proxy.school.com"); clientConfig.proxyPort(3128); //nothing to set username and password :( RestClient client = new RestClient(clientConfig); Resource resource = client.resource("http://vimeo.com/api/v2/artist/videos.xml"); String response = resource.accept("text/plain").get(String.class);
I also tried using BasicAuthSecurityHandler , but it seems to be used to authenticate directly to the web server, not the web proxy
BasicAuthSecurityHandler basicAuthHandler = new BasicAuthSecurityHandler(); basicAuthHandler.setUserName("username"); basicAuthHandler.setPassword("password"); config.handlers(basicAuthHandler);
It still does not work with HTTP 407 error code: Proxy authentication required.
I was looking for the best I could, nothing improved to consume the web service from the Java client via web proxies, if anyone has another idea, feel free to answer
source share