简体   繁体   English

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

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

I am not able to consume RESTful webservice from client. 我无法从客户端使用RESTful Web服务。 I have written in eclipse, even not able to consume it from restclient-ui, but can access sample RESTful web service which is running in my location web logic server. 我用eclipse编写,甚至无法从restclient-ui中使用它,但是可以访问在我的位置Web逻辑服务器中运行的示例RESTful Web服务。 I am in Corporate/company Network. 我在公司/公司网络中。 Getting error Connection Time out exception. 收到错误连接超时异常。

Error from restclient-ui as 来自restclient-ui的错误为

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$26.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

Try setting your company's proxy using: 尝试使用以下方法设置公司的代理:

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

Similarly for http. 对于http同样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM