无法从 Eclipse 中的客户端或 restclient-ui 使用外部 RestFul Web 服务

Not Able to consume external RestFul web service from Client in Eclipse or from restclient-ui

我无法使用来自客户端的 RESTful 网络服务。我用 Eclipse 编写,甚至无法从 restclient-ui 使用它,但可以访问示例 RESTful Web 服务,它在我的位置 Web 逻辑服务器中是 运行。我在 Corporate/company 网络中。收到错误连接超时异常。

来自 restclient 的错误-ui as

Connection to http://api.openweathermap.org refused
org.apache.http.conn.HttpHostConnectException: Connection to http://api.openweathermap.org refused
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:127)
    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576)
    at org.wiztools.restclient.HTTPClientRequestExecuter.execute(HTTPClientRequestExecuter.java:303)
    at org.wiztools.restclient.ui.RESTView.run(RESTView.java:1061)
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:123)
    ... 7 more

尝试使用以下方式设置您公司的代理:

System.getProperties().put("https.proxyHost", "proxyHost");
System.getProperties().put("https.proxyPort", "proxyPort");

与 http 类似。