I am trying to learn how to build web services. I am trying to do the most simple straight forward service and after all day of wasting my time I pretty much don't know what to do any more.
I Have Eclipse Indigo (32bit) with Tomcat 6.0 properly installed. In the server tab I can run/stop server as I wish. I also installed Axis2 1.6.0 engine.
Here are my steps:
1) New Web Dynamic Project
2) When done, click Project Properties > Project Facets and check Axis2 Web Services
3) Eclipse would add all bunch of files to my project. It all seems all right.
4) I would add simple Convert.java file into Java Resources/src (that would be my web service)
package wtp;
public class Convert {
public float celsiusToFarenheit ( float celsius )
{
return (celsius * 9 / 5) + 32;
}
public float farenheitToCelsius ( float farenheit )
{
return (farenheit - 32) * 5 / 9;
}
}
5) Right click on Convert.java file > Web Services > Create Web Service.
I would pick Start Service on the slider on top and click NEXT
6) Next Window would present me with my two methods celsiusToFarenheit and farenheitToCelsius. They are both checked. I would click NEXT
7) Message will show that it's trying to publish service to Tomcat and an error would show up:
IWAB0489E Error when deploying Web service to Axis runtime
axis-admin failed with {http://schemas.xmlsoap.org/soap/envelope/}Client The service cannot be found for the endpoint reference (EPR) http://localhost:8080/MyService/services/AdminService
My questions:
1) How can I solve this? What am I doing wrong? Or is it possible to do anything wrong in these few steps? Tried to look for help on Axis2 website and couldn't find anything useful there.
2) What is actually happening when I click to create New Service?
3) I come from .NET world where you write method, declare it as a web service, and upload file on the server..... and you are done. Is it possible to publish web service like that in Java? I really really hate using any type of wizards in Eclipse because most of the time they don't work. Always something missing and I end up loosing hours Googling....
Thanks,
Any help is appreciated.