我正在尝试使用以下教程开发肥皂服务的消费者http://cxf.apache.org/docs/developing-a-consumer.html http://cxf.apache.org/docs/developing-a-consumer.html
在“使用上下文设置连接属性”部分中,我正在查看下面的代码
// Set request context property.
java.util.Map<String, Object> requestContext =
((javax.xml.ws.BindingProvider)port).getRequestContext();
requestContext.put(ContextPropertyName, PropertyValue);
// Invoke an operation.
port.SomeOperation();
有人可以告诉我是否可以使用 requestContext 属性设置代理服务器设置以及如何设置?我的代码在代理后面运行,我需要传出 SOAP 调用来使用代理服务器设置。
代理设置通常使用 httpconduit 对象来设置
HelloService hello = new HelloService();
HelloPortType helloPort = cliente.getHelloPort();
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(helloPort);
HTTPConduit http = (HTTPConduit) client.getConduit();
http.getClient().setProxyServer("proxy");
http.getClient().setProxyServerPort(8080);
http.getProxyAuthorization().setUserName("user proxy");
http.getProxyAuthorization().setPassword("password proxy");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)