如何在从Axis2 Web服务客户端通过代理服务器调用Web Service时设置代理设置?

时间:2011-08-30 07:01:06

标签: java web-services axis2

无法在Axis2 Web服务客户端中设置代理设置。

1 个答案:

答案 0 :(得分:3)

ServiceClient client = new ServiceClient(); // build your service client here

Options options = new Options();

HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties.ProxyProperties();
proxyProperties.setDomain("");
proxyProperties.setProxyName("");
proxyProperties.setProxyPort(8000);
proxyProperties.setUserName("");
proxyProperties.setPassWord("");

options.setProperty(HTTPConstants.PROXY, proxyProperties);
client.setOptions(options);

...谢谢