aspose file tools*
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
Author

Using HTTPS with Axis2 1.3

Steve Wu
Greenhorn

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

Thanks
Steve
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  70
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
Greenhorn

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( "javax.net.ssl.trustStore", "C:/keystore_certs/client.keystore");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");


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

// web service call
stub.login(doc);

When I made this call I get the following exception:

.apache.axis2.AxisFault: java.lang.NullPointerException
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)


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

java.lang.NullPointerException
at org.apache.axis2.engine.DispatchPhase.fillContextsFromSessionContext(DispatchPhase.java:227)
at org.apache.axis2.engine.DispatchPhase.loadContexts(DispatchPhase.java:156)
at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:95)
at org.apache.axis2.engine.Phase.invoke(Phase.java:308)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)


Thanks
Steve Wu

[ December 07, 2007: Message edited by: Steve Wu ]
[ December 07, 2007: Message edited by: Steve Wu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using HTTPS with Axis2 1.3