Sunday, 20 October 2019

REST and SOAP APIs


REST APIs
  • Is an Architectural style that follows six constraints defined by Roy Fielding in 2000. Those constraints are – Uniform Interface, Client-Server, Stateless, Cacheable, Layered System, Code on Demand.
  • Follows HTTP methods and media type is a chosen by the client/server. Most used media type is JSON.
  • Uses annotations like @Path, @RestController, @Mapping etc
  • REST can use SOAP protocol but SOAP cannot use REST.

SOAP APIs
  • Is a protocol that follows a strict standard to allow communication between the client and the server
  • SOAP uses only XML for exchanging information in its message format.
  • Not only tied to HTTP transport but can also be usable by SMTP.
  • Uses @WebService on interface level.
  • SOAP has SSL( Secure Socket Layer) and WS-security.
That technology for Server APIs is extremely depends on usecase. Many developers found SOAP cumbersome and hard to use. For example, working with SOAP in JavaScript means writing a ton of code to perform extremely simple tasks because you must create the required XML structure absolutely every time.

References:
  • https://smartbear.com/blog/test-and-monitor/understanding-soap-and-rest-basics/

No comments:

Post a Comment