What is web Service?

WebService is a method of communication between two or more application over the network. By using it, information can be exchanged among these two application.

Java Web service APIs

Two main APIs are defined by JAVA for developing web service application.

  • JAX-WS: To develop soap web.
  • JAX-RS: To develop RESTful web services. Here, we are going to discuss about how RESTful webservices using Jersy,Apache CXf, RestEasy.

Before proceeding to the exact implementation, we should have the basic knowledge of webservices

HTTP Method Annotation Description
GET @GET The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
POST @POST The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server
DELETE @DELETE The DELETE method deletes the specified resource.
PUT @PUT The PUT method replaces all current representations of the target resource with the request payload.
OPTION @OPTION The OPTIONS method is used to describe the communication options for the target resource.

To Know more about all the http method types..have a look to the below url
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods