Question

I need to customize the SSL handshaking when calling a JAX-WS API on top of Axis2.

I find no reference at all on how to do this. With Metro I can set a custom SSLSocketFactory, but that uses a non standard API.

How do I get access to the Axis engine so that I can reconfigure it before sending a soap request ?

Was it helpful?

Solution 3

I gave up on Axis2 and WebSphere SOAP. It took less time to just implement my own JAX-WS that support everything I need. Too bad.

OTHER TIPS

You probably have a stub class that extends org.apache.axis2.client.Stub. You can set its transport properties:

YourStubClass stub = new YourStubClass();
stub.initStub(endpointUrl);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT, soapHttpClient);

Where endpointUrl is a String containing the endpoint URL and soapHttpClient is an instance of the Apaches's HTTP Client (org.apache.commons.httpclient.HttpClient).

When you create your HttpClient object, you can customize your SSL handshaking.

Axis2 is configured using axis.xml. Here is the section on http transport.

You may also want to look at the rampart module and how to configure it.

I hope that helps. There's not a lot of information out there on this topic.

You can set the default SSLSocketFactory for the HttpsURLConnection using the static method setDefaultSSLSocketFactory. This will then be the socket factory for al new instaces of HttpsURLConnection. We got this working in an SE application, I think it would work with Axis too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top