我想从Android使用下面的代码访问RESTful web服务。Android的web服务连接被拒绝
ClientConfig config= new DefaultClientConfig();
Client client=Client.create(config);
WebResource service=client.resource("http://localhost:8085/JerseyTest/jersey/test/testing123");
但是我得到以下例外。
07-22 16:53:15.450:E/AndroidRuntime(1491):引起:com.sun.jersey.api.client.ClientHandlerException:java.net.ConnectException:未能连接到本地主机/ 127.0.0.1 (端口8085):连接失败:ECONNREFUSED(连接被拒绝)
但该网址在broswers中运行良好,我也试过防火墙关闭。任何人都可以帮助我?