Java Web Services

01 Sep 2022

What is a web service

Service available over web. The main objective of a web service is to serve data to applications in different platforms such as mobile application, desktop or web applications. Web services are for application consumption and they are language independent.

What is an API?

API stands for Application Programming Interface. It is a bridge between applications. It can be referred as an end-point. For example, http://localhost:8080/employees/1. The same URL can be used for different types of HTTP request such as GET, POST, DELETE, PUT etc.

Best practice: End-points are structured in directory structure

What are the types of web services?

SOAP (Simple Object Access Protocol) based web services (API)

RESTful Web Services (API)

REST stands for Representationsl State Transfer. These services are not protocol based, they are just designed based on the architechtureal pattern.

Key Characterstics

Spring Data JPA (Java/Jakarta Persitence API)

Add an additional abstraction by providing various “Java interfaces” such as

All the above interfaces are referred as Repositories. Implementation classes are provided so there is no need to wrtie the implementation.

API Client

Postman is a popular API client to test end-points. This tool is also available online. Postman facilitates with publishing API documentation which saves time for the API consumers.