ITeye博客

代理访问WebService

Dollyn · 2008-07-29 13:42 · Core Java · Markdown

不知道大家有没有遇到公司需要访问外网的webservice,但公司内部有代理,必须通过代理访问。
再axis中提供了很方便的方法来设置http proxy。
我们在用axis client调用远程webservice时只要加入下面代码即可:
     AxisProperties.setProperty(http.proxyHost,$your proxy host);
     AxisProperties.setProperty(http.proxyPort,$proxy port);
     AxisProperties.setProperty(http.proxyUser,$your username );(如:APACUSER1)
AxisProperties.setProperty(http.proxyPassword,$password);
AxisProperties是全局静态变量一次设置在整个生命周期中都会生效。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。