Site icon LCDUNG

Web services (APIs)

What is Web API?

SOAP vs REST comparison

Origin

REST SOAP
– REST (Representational State Transfer) was Created in 2000 by Roy Fielding in UC, Irvine.
– Developed in an academic environment, this protocol embraces the philosophy of the open Web
– SOAP (Simple Object Access
Protocol), was created in 1998 by Dave Winer et al in collaboration
with Microsoft.
– Developed by a large software company, this protocol addresses the goal of addressing the needs of the enterprise market.

BASIC CONCEPT

REST SOAP
– Makes data  vailable as resources (nouns), for example “user” or “invoice” – Makes data available as services (verb + noun), for example “getUser” or “PayInvoice”

ADVANTAGES

REST SOAP
– Follows the philosophy of the Open Web
– Relatively easy to implement and maintain
– Clearly separates client and server implementations
– Communication isn’t controlled by a single entity
– Information can be stored by the client to prevent multiple calls
– Can return data in multiple formats (JSON, XML etc)
– Follows a formal enterprise
approach
– Works on top of any communication protocol, even asynchronously
– Information about objects is communicated to clients
– Security and authorization are part of the protocol
– Can be fully described using WSDL

DISADVANTAGES

REST SOAP
– Only works on top of the HTTP
protocol.
– Hard to enforce authorization and security on top of it
– Spends a lot of bandwidth communicating metadata.
– Hard to implement and is unpopular among Web and mobile developers.
– Uses only XML.

WHEN TO USE

REST SOAP
– When clients and servers operate on a Web environment
– When information about objects doesn’t need to be communicated to the client
– When clients need to have access to objects available on servers
– When you want to enforce a formal contract between client and server

COMMON USE CASES

REST SOAP
– Social Media services
– Social Networks
– Web Chat services
– Mobile Services
– Synchronize applications
– Financial services
– Payment gateways
– Telecommunication services

POPULAR EXAMPLES

REST SOAP
– Facebook APIs
– Google APIs
– YouTube APIs
– Twitter APIs
– LinkedIn APIs
– Instagram APIs
– Salesforce SOAP API
– Paypal SOAP API
– Clickatell SMS SOAP API
– Almost Banking Systems

APIs Security

Caching Data

Why to optimize?

COST !!!

Cache Types

Logging

Why to log?

Logging Levels

Testing

Why should we do API testing?

Can help find/isolate problems:

Reduce business costs

Exit mobile version