Web Service
Contents
What is web service
Software system designed to support interoperable machine-to-machine interaction over a network.
Three keys:
- machine to machine (todo service is not)
- Interoperable (not platform dependent)
- Over a network
Different kinds of web services
SOAP
Use XML as exchange format
Adhere to Structure: Envelope - Header - Body
REST
The format of request/response is HTTP
resources
A resource has an URI, it is what you want to present in your application
A resource can have different representations
- XML
- HTML
- JSON (most popular)
Define and perfom actions on resources using HTTP POST/GET/PUT/DELETE
How to build web service
How does applications communicate
Application <==request, response==> web service
How to make communication platform independent? Use data exchange format:
- XML
- JSON
Transport:
- HTTP
- MQ
Tools
- Browser
- Curl
- Postman
Browser makes it hard to send Post/Put/Delete command, that’s why we use Postman