Wednesday, November 29, 2017

API Testing 01: What is a web service and what is an API?

In the real-world applications talk (exchange data) with each other over the Internet using HTTP protocol. The applications may be developed in different technologies like Java, .Net, PHP, Python and etc. Even though the applications are developed in different technologies there should be a common messaging system like XML or JSON for data exchange.

This data exchange across different applications over the Internet is called web service. In a web service, service will be offered by an electronic device to another electronic device for communicating with each other via World Wide Web (Internet).



There are two main components in a web services Client and Server.

The machine requesting for information is called Client and the machine providing the requested information as response is called Server. Typically Web Service is an object-oriented web based interface between client and server.

Application Program Interface (API)Technically an API – is set of functions or methods that are used in developing a product or service.

In other words – It is an application program that interacts with other applications internally or externally and retrieves required information.

Example 1: Consider POI API from Apache, we are using this in our project to read/write excel data.

Example 2: Consider java.util.File package, this is also an API. We are using this in our project for file I/O operations.

Example 3: In the similar way Selenium WebDriver is also an API that contains different methods to perform actions on the browser.

If you are booking a flight ticket on goibibo.com, you will be entering source, destination and date of travel and clicking on the search button. A program from goibibo.com takes all the user data and it will communicates with the different flight service servers like Air India, Air Asia, Indigo, Jet Airways and etc. and retrieves the corresponding  data and displays on the page Goibibo page. This program from goibibo.com side which is taking the user data is called an API.

Hope you this post gave basic understanding about Web Services and API. In the next post we will see what is API testing and what are the advantages of it. API Testing 02: What is API testing?

#HappyLearning #HappyTesting

1 comment:

  1. REST API is a set of functions helping developers in performing requests along with receiving responses. Through HTTP protocol interaction is made in REST API.

    Thanks for sharing such a valuable post and Keep Sharing !!!!
    API testing

    ReplyDelete

Java Program 5: How to reverse given string and each word of it?

Let us understand the problem with an example, suppose "Learn Core Java" is the given string then the expected output should be &...