Apache CXF客户端代理设置

编程入门 行业动态 更新时间:2024-10-27 00:25:58
本文介绍了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客户端代理设置

本文发布于:2023-10-26 10:57:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529935.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   Apache   CXF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!