Web Services Architecture
Types of Web Services
1. SOAP Web Service
SOAP stands for Simple Object Access Protocol, it is a standardized protocol for message exchange between web applications. The message format supported by SOAP is XML. A web service that is based on SOAP protocol is called SOAP web service.
2. RESTful Web services or REST API
REST stands for Representational State Transfer, it is an architectural style that describes some constraint for web service development. A web service that satisfies these constraints is called RESTful web service.
The six REST architecture constraints are
Client-Server – Client and server are separated by a uniform interface and are not concerned with each other’s internal logic
Stateless – Each client request is independent and contains all the necessary information required to get executed. No client data is saved at the server.
Cacheable – Client should have the ability to cache the responses
Layered System – A layered system having multiple layers wherein each layer communicates with adjacent layer only
Uniform Interface – A uniform interface design requires each component within the service to share a single and uniform architecture
Code on Demand – This constraint is optional. It extends client-side execution of code transfer of executable scripts like javascript from the server.
RESTful APIs implements the following types of HTTP methods
GET – HTTP GET method is used to retrieve some informationPOST – HTTP POST method submits and creates new resources
PUT – HTTP PUT is used to update an already existing resource
DELETE – HTTP DELETE is used to delete a resource