I'm looking for the best way to use custom factories on a per-call basis.
For
example, I want to set axis.socketSecureFactory to use a provider with a
custom
SSLContext to deal with untrusted server-side certificates, etc.
The only way I can see to do this is to call
AxisProperties.setProperty("axis.socketSecureFactory", "myCustomFactory");
However, this is a static, global method that affects the entire JVM. I
don't
want to override the default factory for call calls - or even for a given
thread, but on a per-call basis.
Am I missing something, or is this a limitation due to all the static
methods in
HTTPSender/SocketFactoryFactory?
(When working with URL connections directly without going through Axis, this
is
as easy as:
HttpsURLConnection huc = (HttpsURLConnection)url.openConnection();
huc.setSSLSocketFactory(mySocketFactory);
// How to do the same within Axis??
)
Thanks!