File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Using HTTPS with Axis2 1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Using HTTPS with Axis2 1.3 " Watch "Using HTTPS with Axis2 1.3 " New topic

Using HTTPS with Axis2 1.3

Steve Wu

Joined: Nov 28, 2007
Posts: 4
I am new to Axis2. Does any body know good articles on how to setup HTTPS in Tomcat and Axis2?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
This introduction to SAAJ has, strangely enough, an in-depth discussion of setting up Tomcat and a WS client with HTTPS, at its very end. It predates Axis2, but the principles haven't changed.
Steve Wu

Joined: Nov 28, 2007
Posts: 4
Thanks for the acticle Ulf.
I configure my Tomcat5.5.25 as mentioned in the artcile and make a web service call from a client as follow:

System.setProperty( "", "C:/keystore_certs/client.keystore");
System.setProperty("", "changeit");

AuthenticationServiceStub stub = new AuthenticationServiceStub(https://localhost:8443/mytest/services/LoginService);
// initialize data here

// web service call

When I made this call I get the following exception:

.apache.axis2.AxisFault: java.lang.NullPointerException
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(
at org.apache.axis2.description.OutInAxisOperationClient.send(
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
at org.apache.axis2.client.OperationClient.execute(

But if I had a browser asscessing my services in HTTPS mode as (https://localhost:8443/mytest/Services/), the above client call succeed.

My question are:
1) why do I have the browser open in order to make a HTTPS webservice call?
2) Am I missing some configuration in Axis2 or Tomcat not mentioned in the article?

Here's the exception thatis thrown in Tomcat console

at org.apache.axis2.engine.DispatchPhase.fillContextsFromSessionContext(
at org.apache.axis2.engine.DispatchPhase.loadContexts(
at org.apache.axis2.engine.DispatchPhase.checkPostConditions(
at org.apache.axis2.engine.Phase.invoke(
at org.apache.axis2.engine.AxisEngine.invoke(
at org.apache.axis2.engine.AxisEngine.receive(
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
at org.apache.axis2.transport.http.AxisServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
at org.apache.tomcat.util.threads.ThreadPool$

Steve Wu

[ December 07, 2007: Message edited by: Steve Wu ]
[ December 07, 2007: Message edited by: Steve Wu ]
I agree. Here's the link:
subject: Using HTTPS with Axis2 1.3
It's not a secret anymore!