本文介绍了Apache CXF客户端代理设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用的教程开发肥皂服务消费者 cxf.apache/docs/developing-a-consumer.html
在使用上下文设置连接属性一节中我正在查看下面的代码
In the section ,"Setting Connection Properties with Contexts" I am looking at the code below
// 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调用以使用代理服务器设置。
Can someone tell me if I can set the proxy server settings using the requestContext properties and how ?. My code is running behind a proxy and I need the outgoings SOAP calls to use proxy server settings.
推荐答案代理设置通常设置通过使用httpconduit对象
Proxy setting are usually set by using httpconduit object
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");更多推荐
Apache CXF客户端代理设置
发布评论