Table of contents
1.
Introduction👨‍✈‍
2.
Verifying APIs in ReadyAPI✅
3.
Inferring REST Schemas📋
3.1.
Sample Request⚙️
3.2.
Create the Project and Service🧶
3.3.
Get Response🏂🏻
3.4.
Creating a Schema🧙🏻
3.5.
Adding More Requests to Schema➕
3.6.
Use the Schema🧤
4.
SOAP WS-I Compliance📋
4.1.
Validating WSDL Definitions🕶
4.2.
Validating SOAP Requests and Responses👓
5.
Frequently Asked Questions
5.1.
What is "ReadyAPI"?
5.2.
Is "ReadyAPI" open source?
5.3.
What is "SmartBear"?
5.4.
What does API stand for?
5.5.
What is the use of API?
6.
Conclusion
Last Updated: Mar 27, 2024

Verifying APIs in ReadyAPI

Author Sanchit Kumar
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction👨‍✈‍

When dealing with APIs in "ReadyAPI", you must ensure that the APIs you are importing are per the company's standards. But the question is how to validate or verify APIs in ReadyAPI. Okay! The answer is we can validate APIs with the "WS-I Inference tool". Cool! Are you wondering how to do it? Fine! Are you ready

verifying apis in readyapi

So let us learn about verifying APIs in ReadyAPI.💫

Verifying APIs in ReadyAPI✅

Before you validate your APIs with the "WS-I Inference tool" and compare requests with the schema, you need to know how to infer a schema for a web service.

Inferring REST Schemas📋

The "REST Schema" inference is a way of creating the schema for a service. You can use this way when the schema is not provided in the service definition or if it is outdated. Here in this topic, you learn how you can infer a schema for a web service.

Sample Request⚙️

We will use a demo response from the "Flickr REST example" service in this sample request to see how ReadyAPI uses schemas. Check the given below URL ➡️

https://www.flickr.com/services/rest/?method=flickr.test.echo&format=rest&foo=bar&api_key=ccb3963d82bbf07bcfb87a1791ff2d87


📌If the request is successful after you hit the above URL in your browser. It will show a response similar to the image given below ➡️

successful response

📌If the response comes as given below image ➡️

error response


🔗Goto "Flickr REST demo website" scroll down and see a demo response. Copy the API key value and replace this value in your URL and try again.

Create the Project and Service🧶

Follow the steps below to create a project with the "REST" service.

1️⃣In the main menu, select "File", then click "New Functional Test".

new functional test

2️⃣Click on "Start".

start

3️⃣Under the URL option, insert the following URL, click "Next", and specify the project. ➡️
https://www.flickr.com/services/rest/?method=flickr.test.echo&format=rest&foo=bar&api_key=ccb3963d82bbf07bcfb87a1791ff2d87

next

4️⃣ReadyAPI will suggest adding assertions to the test. You will not need them, so you can uncheck them and click "Next".

next

5️⃣"ReadyAPI" will offer you to run the test or create a data-driven test. You do not need either option. Close the dialogue.

confirmation dialogue


Note ⚠️- "ReadyAPI" creates the project with the "Flickr API". You can find it in the navigator.

navigator

Get Response🏂🏻

The request is now available in "ReadyAPI".

1️⃣ To find the request, click on the plus icon to expand all project items.

project items

2️⃣Double-click on the request.

"ReadyAPI" will display the parameters in the "Request" section.

request section

3️⃣The request has all the parameters defined in the URL. You will see the empty "Response" section if you haven't sent the request yet.

outline

4️⃣Now, click on the green play button icon to get the response from the server.

run

Response - 

response

Creating a Schema🧙🏻

The "Schema" panel shows the detected schema conflicts.

schema

The response analysis shows conflicts between the current response and the previously inferred schema. In this case, this is typically because no prior schema exists.


Follow the given below steps to create a schema manually - 

1️⃣Remove the selection from the "Auto-Resolve" check box.

auto resolve

2️⃣Click "Resolve Conflicts" in the "Schema" panel to resolve the conflicts manually.

resolve conflicts

3️⃣For each detected conflict, you will get a notification and can take necessary actions.

action

4️⃣We can resolve all conflicts at once because there is no previous schema. Click "Yes to all".

5️⃣"ReadyAPI" resolves all conflicts and adds them to the "Schema" panel.

resolve conflicts

6️⃣After "ReadyAPI" resolves all conflicts, it adds the schema to the schema's tab.

schema
note

Adding More Requests to Schema➕

You need to send a different request to add more definitions to the schema. You may use the "Auto-Resolve" option as we can assume the responses to be valid.

1️⃣Open the "Conflicts" tab and select the "Auto-Resolve" option.

auto resolve

2️⃣To get a different response, remove the api_key parameter value from the request.

api_key value

3️⃣Now, click on the green play button icon.

start

4️⃣The response will contain an error.

error

5️⃣"ReadyAPI" resolves and logs errors automatically.

logs

6️⃣When all conflicts are resolved, the new response will appear in the schema.

new response


Here is the comparison between the resources - 

comparison


You can modify the request to get more different responses and create a more complex schema.

Use the Schema🧤

The primary purpose of inferred schemas is to verify that the service response contains no unexpected elements. Use the "Schema Compliance" assertion for this ➡️ 

1️⃣Expand the "Assertions" panel and click on the plus icon.

assertions panel

2️⃣Select Compliance, Status, and Standards, then "Schema Compliance", and click on "Add".


"ReadyAPI" adds the assertion and automatically verifies the incoming responses.

Tip 💡- The schema is also displayed on the specification page of the API editor. Click on the reload icon if the schema is not displayed to reload the definition.


Fine! So far, we have learnt about inferring REST schemas. Let us see the second part of our article on verifying APIs in ReadyAPI. And learn about SOAP WS-I Compliance.

SOAP WS-I Compliance📋

ReadyAPI has integrated support for the WS-I organisation "Basic Profile" validation tool.

This tool is available when you select the interface in the navigator.

tool


The "WS-I Compliance tool" settings are available on the WS-I setting page in "Preferences". Or click on the setting icon to access the configuration settings.

setting

Validating WSDL Definitions🕶

To run the WS-I compliance tool for a WSDL definition - 

1️⃣Open the "SOAP" interface from the navigator.

2️⃣Switch to the "WSI-Compliance page".

3️⃣Now, click on the green play button icon to create a WS-I report for this interface.

wsi report


Or, in the navigator, right-click on the SOAP interface and select "Check WSI Compliance" to run the WS-I Test Tools and validate the "WSDL"  definition.

check wsi compliance

Validating SOAP Requests and Responses👓

To validate a request or response:

1️⃣Open a request or response in the "Request Editor".

2️⃣Right-click on the request or response and select "Validate".


We hope you understood about verifying APIs in ReadyAPI. Wait! Do you still have doubts? Keep going.

Frequently Asked Questions

What is "ReadyAPI"?

"ReadyAPI" is one of the products of "SmartBear". It is an easy-to-use no-code API testing platform designed to streamline the testing workflows.

Is "ReadyAPI" open source?

"ReadyAPI" includes third-party open-source software modules subject to their respective licenses.

What is "SmartBear"?

"SmartBear" software is an American privately-held IT company that delivers tools for APM(application performance monitoring), software development and testing, API testing and management.

What does API stand for?

API stands for Application Programming Interface.

What is the use of API?

API is a software intermediary that allows two different applications to communicate.

Conclusion

In this article, we discussed verifying APIs in ReadyAPI. We learnt to validate our APIs with the "WS-I Inference tool" and compare requests with the schema.

We hope this blog on verifying APIs in ReadyAPI was helpful. You can refer to other similar articles as well - 


Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enrol in our courses and refer to the mock test and problems available. Take a look at the interview experiences and interview bundle for placement preparations.

Happy Learning Ninja! 🥷

Live masterclass