"407 Proxy Authentication required"
You will have to configure your RestTemplate by the following steps:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final static String PROXY_HOST = "url"; | |
private final static int PROXY_PORT=9999; | |
private final static String PROXY_USER = "user"; | |
private final static String PROXY_PASSWORD = "pass"; | |
... | |
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(); | |
DefaultHttpClient defaultHttpClient = (DefaultHttpClient)factory.getHttpClient(); | |
defaultHttpClient.getCredentialsProvider().setCredentials(new AuthScope(PROXY_HOST, PROXY_PORT), | |
new UsernamePasswordCredentials(PROXY_USER, | |
PROXY_PASSWORD)); | |
factory.setHttpClient(defaultHttpClient); | |
restTemplate.setRequestFactory(factory); | |
Response respuesta = restTemplate.postForObject(DEV_RESTFUL, r,Response.class,vars); | |
... |
If you try to connect again with a UnitTest that will fix your problem.
Best Regards,