Tutorial 10
Tutorial 10
Contents:
Introduce about web services
Create RESTful web services with Java Spring Boot
Prerequisites:
o Install Postman (desktop app) or Talend API Tester (Chrome extension) to
test API (Application Programming Interface). You can use alternatives.
Introduction:
1. Formats of APIs:
o XML: eXtensible Markup Language
o JSON: JavaScript Object Notation
2. Types of web services
o SOAP: stands for Simple Object Access Protocol. SOAP is an XML based
industry standard protocol for designing and developing web services
o REST: stands for Representational State Transfer. REST is an
architectural style for developing web services
3. REST Architectural Style
o REST is a simple way to organize interactions between independent
systems. It is simpler than complex mechanisms such as RPC or SOAP
o Properties: simplicity, modifiability, visibility, portability, reliability
4. RESTful Web Service
o REST architecture-based web services
o Lightweight, maintainable, scalable
o Used to create APIs for web-based application
o The calling client can perform operations using RESTful service
o The protocol for REST is HTTP
7. Run the web application then test Restful APIs with Postman
Figure 9 - View all students (GET method)
Figure 10 - View student by ID (GET method)
Figure 11 - Add new student (POST method)
TASKS:
- Add data validation for Entity & Controller then re-test with Postman
- Create similar Restful APIs for previous Spring Boot projects (Refer to
Tutorial 7+8+9)
- Compress the whole project and submit to FIT LMS with file name syntax:
FullName_StudentID_SE1_Tut10.zip