I did exactly what you're describing recently, but I basically took the
envelope from the generated code and submitted it myself using the
commons-http lib.
 
Protocol authhttps = new Protocol("https", new
AuthSSLProtocolSocketFactory(

new URL("file:" + getKeyFileName()), getPassword(), 

new URL("file:" + getTrustFileName()), getPassword()), 443);

HttpClient client = new HttpClient();

client.getHostConfiguration().setHost(getURL(), 443, authhttps);

ORBWSStub requestObject = new ORBWSStub(); 

String env = requestObject.getEnvelope(myObj);

PostMethod httpget = new PostMethod(getPage());

httpget.addRequestHeader("SOAPAction", "\"TheAction\"");

httpget.addRequestHeader("Content-Type", "text/xml; charset=utf-8");

httpget.setRequestBody(env);  //this method is deprecated, but still
works.

int success = client.executeMethod(httpget);

I also had to modify the AuthSSLProtocolSocketFactory to use an already
generated store in pkcs12 format, but that was a relatively minor
change.
 
Thanks,
Jennifer Ford

________________________________

From: Merritt, Norris [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 06, 2007 1:37 PM
To: [email protected]
Subject: How to configure Axis2 so commons-http client uses custom SSL
socket factory like the contributed AuthSSLProtocolSocketFactory?



Hi, I need to make Axis2 use a custom SSL socket factory so I can do SSL
client authentication. Commons-http supports the notion of custom SSL
socket factories, and there is a contributed one called
AuthSSLProtocolSocketFactory which looks like it does what I want. My
question is how to configure Axis2 to use this SSL socket factory
instead of the default one that it uses now.  I assume this can be done
without modifying Axis2 source code? Any pointers / help greatly
appreciated....

Reply via email to