- Web Service if we say it service delivered over the web the answer is partial no because even with the html we can make simple web page with some elements like buttons login pages etc but html is not for application to application interaction.
- So Web Service is the software system designed to support interoperable(exchangable) machine-to-machine interaction over a network.
- if HTML uses the bussiness logic and data to show the response over the web its becomes interactive application.
-
webservice should be able to call from diff diff applications(Java, Python, PHP, etc..)
- 3 rules which makes a web service
- 1) Designed for machine-to-machine(app-to-app) interaction.
- 2) Interoperable (platform independent) β> Accepts applications build using any technologies. s/w that can run on variety of h/w platforms or s/w architectures is called as platform independent. EX: java can be executed on eclipse, intellij and used in springboot framework and microservices.
-
3) Allow Communication over network β> should be deployed over internet or some other system and should be able to interact with application.
- Requests and Responses should be platform independent to achieve webservice. Two popular data exchange platforms are
- 1) XML(Extensible markup language) β> XML is a s/w and h/w independent tool for storing and transporting data.
-
2) JSON (JavaScript Object Notation) β> JSON is a text format for storing and transporting data. Object notation (key-value pair).
- Application should send request and when it gets response from website it should be able to process the response.
- Application will know that the request to be sent and what response it receives by Service Defination
- Service defination defines about what is request/response format, request structure, response structre, EndPoint.