欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CXF 设置代理

程序员文章站 2022-06-14 16:10:10
...
CXF 中文资料确实有限,既然查到了就记一下:
CXF 客户端设置代理代码如下:
Client client = ClientProxy.getClient(port);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(3600);
httpClientPolicy.setAllowChunking(false);
httpClientPolicy.setProxyServer("192.168.115.49");
httpClientPolicy.setProxyServerPort(8082);
http.setClient(httpClientPolicy);