Web Services Architecture

Features of web services
  • As web services are based on open standards like XML, HTTP so these are operating system independent
  • Likewise, web services are programming language independent, a java application can consume a PHP web service
  • Web services can be published over the internet to be consumed by other web applications
  • The consumer of web service is loosely coupled with the web service, so the web service can update or change their underlying logic without affecting the consumer
  • 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.

    API

    RESTful APIs implements the following types of HTTP methods

    GET – HTTP GET method is used to retrieve some information
    POST – 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


    Last modified: Tuesday, 17 December 2019, 6:03 PM