認証が必要な学校のWebプロキシを介してApacheWinkフレームワークを使用してJavaでRESTfulWebサービスを利用しようとしています
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);
私も使用しようとしましたBasicAuthSecurityHandler
が、Webプロキシではなく、Webサーバーに対して直接認証するために使用されているようです。
BasicAuthSecurityHandler basicAuthHandler = new BasicAuthSecurityHandler();
basicAuthHandler.setUserName("username");
basicAuthHandler.setPassword("password");
config.handlers(basicAuthHandler);
それでもHTTP407エラーコードで失敗します:プロキシ認証が必要です。
私はできる限りグーグルで検索しました。JavaクライアントからWebプロキシを介してWebサービスを利用するのにこれ以上良いものはありません。誰かが別のアイデアを持っている場合は、遠慮なく応答してください。