Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java HttpClient 4.5.2代理设置_Java_Web Services_Proxy_Spring Batch_Apache Httpclient 4.x - Fatal编程技术网

Java HttpClient 4.5.2代理设置

Java HttpClient 4.5.2代理设置,java,web-services,proxy,spring-batch,apache-httpclient-4.x,Java,Web Services,Proxy,Spring Batch,Apache Httpclient 4.x,我需要通过代理调用第三方web服务 我只有以下信息: -第三方https IP和端口 -代理http IP和端口 我可以知道我需要代理的凭据:用户名和密码吗 我的部分代码如下:- CloseableHttpClient httpclient = HttpClients.createDefault(); HttpHost proxy = new HttpHost(proxyHost, proxyPort); DefaultProxyRoutePlanner routePlanne

我需要通过代理调用第三方web服务

我只有以下信息:
-第三方https IP和端口
-代理http IP和端口

我可以知道我需要代理的凭据:用户名和密码吗

我的部分代码如下:-

CloseableHttpClient httpclient = HttpClients.createDefault();

    HttpHost proxy = new HttpHost(proxyHost, proxyPort);
    DefaultProxyRoutePlanner routePlanner = new
    DefaultProxyRoutePlanner(proxy);
    CloseableHttpClient httpclient = HttpClients.custom()
    .setRoutePlanner(routePlanner)
    .build();

        RequestConfig config =RequestConfig.custom().setProxy(proxy).build();

            HttpPost httppost = new HttpPost(queryUrl);
            httppost.setConfig(config);

CloseableHttpResponse httpResponse = httpclient.execute(httppost);
不幸的是,代理服务器响应我“访问被拒绝。需要身份验证。”

对这个问题有什么想法吗