So, now I have created a basic web service in Eclipse. I want to publish it to an Apache Tomcat server permanently, not just for testing using Eclipses Server debug mode. Fortunately, Eclipse makes this easy to export, and Tomcat makes this easy to import.
First step is to select the project in the Eclipse Project Explorer. Right-Mouse clicks on the project and choose Export. Under the export menu, choose Web/WAR File. By default, your class should appear under the Web Module, or under the drop down list. If it doesn’t, something went wrong. Choose a Destination directory (in my case, I choose C:\TEMP) and your all set.
Now, go to your Tomcat Manager URL. In my case, it is http://localhost:8080/manager/html.
Once there, I go down the about 2/3 of the page in the Upload a War file to Install section, choose Browse, go to the C:\Temp folder, and select my .WAR file. Then I select the Install button. Now, I can see the MyWebService under the list of applications. Now comes the tricky part. If I click on it, I will get a 404 Page Not Found error. The reason being, the context is set differently in the web apps web.xml file.
To find out the correct location, I go to see the WSDL file that got imported under my Tomcat webapps folder. For me, this is located at C:\Program Files\Apache Software Foundation\Tomcat 4.1\webapps\MyWebService\wsdl\MyWebService.wsdl. Once I open up this file, I get clued into the location to find my web service, which is at http://localhost:8080/MyWebService/services/MyWebService. To confirm this works, I pull the online WSDL file at http://localhost:8080/MyWebService/services/MyWebService?wsdl.
Now I am ready to move on with my RCP application since the planned exodus of Googles Web Toolkit.