由于网络环境要求,不能直接连接HTTP所以要设置一下代理。
在初始化类Client里的creater方法service1赋值后加上以下代码:
service1.setProperty(CommonsHttpMessageSender.DISABLE_PROXY_UTILS, true);
service1.setProperty(CommonsHttpMessageSender.HTTP_PROXY_HOST, proxyHost);
service1.setProperty(CommonsHttpMessageSender.HTTP_PROXY_PORT, proxyPort);