Hi,
I'm trying to get a tomcat/axis2 web service working over HTTPS.
I know this has been ask over and over but I haven't (yet) found the solution.
To keep things clear I've created a web service that simply add two integers together and returns the sum.
Relevant info:
Eclipse Indigo
Axis 2 (2-1.6.1)
Tomcat 6:
-with keytool created certificate in the ${user.home}./keystore file:
- server.xml has:
Basically I followed these instructions:
Tomcat6_SSL_HOW_TO
So, first things first I create the addNums web service :
Eclipse creates the WebContent directory with the following relevant files:
WebContent\WEB-INF\services\addNums\META-INF\services.xml:
WebContent\WEB-INF\web.xml:
At this point I can access the main web service page with https
https://localhost:8443/AddNumbers/
But if I click on the 'Services' link I get the error "https is forbidden"
To fix that I add the following the the /WebContent/WEB-INF/conf/axis2.xml file:
I restart tomcat and I can get to the 'Services' page (
https://localhost:8443/AddNumbers/services/listServices)
It correctly shows my addNums web service. I can click on that link to get the WSDL (
https://localhost:8443/AddNumbers/services/addNums?wsdl)
All good so far.
Using the Eclipse wizard I create a web service client to
test.
AddNumbersClient
- AddNumsCallbackHandler.java
- AddNumsStub.java
- AddNumbersClient.java (manually created by me and calls stub.addNumbers(Numbers); with the numbers 41 and 1)
I run this as a '
Java application' and the console windows displays the answer 42.
Good.
Then I edit AddNumsStub.java to change:
this(configurationContext,"http://localhost:8080/AddNumbers/services/addNums.addNumsHttpSoap11Endpoint/" );
to
this(configurationContext,"https://localhost:8443/AddNumbers/services/addNums.addNumsHttpSoap11Endpoint/" );
and rerun the client. This time I get errors:
So, what else do I need to do to get HTTPS to work? I'm guessing it has something to do with the WSDL file but I'm stuck.
Any ideas?
Thanks
Chris