I will show you how to create your own simple java web service.Getting Started
First of all, we need to set up a server to host the web service. I’m using Glassfish 4.0, which allows you to host a local server on your own machine. You can install it yourself and point your IDE in the direction of it’s installation folder. Alternatively, with NetBeans you can download and install Glassfish (amongst others) when you create the project.
Now we need to create the project, in NetBeans:
- Go to File>New Project.
- Select the Java Web category and in the adjacent window select Web Application.
- Name your project and then press next.
- Select which server you want to use e.g. GlassFish. If no servers are available click Add and select Glassfish, press next and download the server.
- Press finish.
- You may get a page created called index.html, you can close it as it’s not needed.
in your projects window, right click the Source Packages folder, go to New and from the list Select Java Class. You can choose Web Service and it will create a fully generated web service class with some example methods....