Skip to content

Microservices with Spring Boot and Spring Cloud

Amitha R edited this page Dec 17, 2020 · 12 revisions

Microservices with Spring Boot and Spring Cloud

Introduction to Web Services

What is a Web Service?

  • Service delivered over the web.
  • Software system designed to support interoperable machine-to-machine interaction over a network.
Web Services - 3 Keys:
  1. Designed for machine-to-machine(or application-to-application) interaction.
  2. Should be interoperable - Not platform dependent. (Application A (Java), Application B(.Net), Application C (PHP)) - Irrespective of their technologies they should be able to talk to the ToDo service.
  3. Should allow communication over a network. (Communication should not be bound within a local machine).

Important questions related to web services

  1. How does data exchange between applications take place?

              -----Request------->
    

| Application A |---------------------| WebService |

             <-----Response-------
  • Application A is consuming a web service.
  1. How can we make web services platform independent?
  • The Request and Response of the webservice must be platform independent.
  • There are two popular formats for requests and responses.

a. XML

  • Extensible Markup Language.

<getCourseDetailsRequest>
<id>Course1</id>
</getCourseDetailsRequest>

b. JSON

  • Javascript Object Notation [ { "id": 1, "name": "Even", }, { "id": 2, "name": "Odd", } ]
  1. How does the Application A know the format of Request and Response?
  • Application A needs to send a request to the web service and once it gets the response it needs to be able to process it.
  • Service Definition:
  • Every web service offers a service definition
  • The service definition would specify: i. Request/Response Format - JSON, XML, etc.
    ii. Request Structure
    iii. Response Structure
    iv. Endpoint

Clone this wiki locally