Web services are web application components that lets two different applications to communicate over the network.Let if an application which in written java provides web services can be communicated through other languages like PHP,.Net,Python etc.
Restful Web Services are very known among web programmers.Using web service you can allow to different applications build on any technology like PHP,.Net etc to communicate over the network in platform independent manner.
JAX-RS API is used to develop RestFul web services. in Java. Most commonly used implementation isJersey.JAX-RS specification provides annotations that are used by service programmer for annotating service methods and service class.
Commonly used annotations
- @Path: This annotation is used to associate a URI to a service class and methods.
- @GET: This annotation is used to associate HTTP GET request to a service method.
- @POST: This annotation is used to associate HTTP POST request to a service method.
- @PUT: This annotation is used to associate HTTP PUT request to a service method.
- @DELETE: This annotation is used to associate HTTP DELETE request to a service method.
- @Produces:This annotation is used to specify the representation of a resource which is produced by a method.
- @Consumes: This annotation is used to specify the representation of a resource which is consumed by a method.
For detailed explanation click here.