轴SecureSocketFactory - 设置构造属性 [英] Axis SecureSocketFactory - Setting the constructor attributes

查看:546
本文介绍了轴SecureSocketFactory - 设置构造属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户SecureSocketFactory设置使用以下属性使得HTTPS连接时由轴使用:

I have a customer SecureSocketFactory set to be used by Axis when making an https connection using the following property:

AxisProperties.setProperty("axis.socketSecureFactory",
    "com.metavante.csp.model.manager.mobilepayments.MonitiseSSLSocketFactory");

当这个类是由轴实例,用一个Hashtable(属性)构造函数被调用。我看到的超时属性是在这个表中设置。反正有这个设置更多的价值?
我希望能够通过静态或系统属性的每个实例场景配置套接字工厂,而不是全球。

When this class is instantiated by Axis, the constructor with a Hashtable (attributes) is called. I see the timeout attribute is set in this table. Is there anyway to set more values in this? I would like to be able to configure the Socket Factory on a per-instance scenario instead of globally by using static or system properties.

修改:我发现这些属性实际上是HttpSender(BasicHandler)选项。我依然无法设置这些动态,虽然

Edit: I found out these attributes are actually the HttpSender (BasicHandler) options. I still am unable to set these dynamically though.

推荐答案

您可以检索的SocketFactory实例,然后更改或添加的属性,如果你有兴趣在修改的SocketFactory行为。但是,如果你这样做,你也应该注入的HashTable属性(超时)。我想,没有一个最终的pretty解决方案。

You can retrieve the SocketFactory instance and then change or add attributes, if you are interested in modify SocketFactory behavior. But if you do this, you also should inject the HashTable attribute (with the timeout). I think there is not a final and pretty solution.

AxisProperties.setProperty("org.apache.axis.components.net.SecureSocketFactory", MyAxisSocketFactory.class.getName());
MyAxisSocketFactoryfactory = (MyAxisSocketFactory) SocketFactoryFactory.getFactory("https", myHashTableParams);
factory.setMyStuff();

这code后,将创建的SocketFactory实例和配置,并准备在Web服务中使用,或任何^ _ ^

After this code, the instance of SocketFactory will be created and configured, and ready to use in web services, or whatever ^_^

这篇关于轴SecureSocketFactory - 设置构造属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆