Axis SecureSocketFactory - Setting Designer Attributes

I have a SecureSocketFactory client that Axis will use when creating an https connection using the following property:

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

When this class is instantiated by Axis, the constructor with the Hashtable (attributes) is called. I see that the timeout attribute is set in this table. Is there a way to set more values โ€‹โ€‹in it? I would like to be able to configure Socket Factory for a script for each instance instead of global use using static or system properties.

Change I found out that these attributes are actually HttpSender (BasicHandler) parameters. I still can't install them dynamically though.

+3
attributes factory axis
source share
2 answers

I figured out the way around the problem. In my code, where I wanted to set the property, I use: serviceLocator.getEngine().setOption(USE_CERT_PROPERTY, new Boolean(true));

where getEngine returns the used AxisEngine. Then in the factory socket, I can:

 Boolean useSMS = (Boolean) MessageContext.getCurrentContext().getProperty(OtherClass.USE_CERT_PROPERTY); 

I could set the object to anything, maybe I will go with the name of the certificate I needed. Hope this helps someone.

+1
source share

You can get an instance of SocketFactory, and then change or add attributes if you are interested in changing the behavior of SocketFactory. But if you do, you must also enter the HashTable attribute (with a timeout). I think there is no final and beautiful solution.

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

After this code, a SocketFactory instance will be created and configured and ready for use in web services or something like ^ _ ^

+1
source share

All Articles