How to use SOAPUI as a RESTful API Request response Simulation tool

Source: Internet
Author: User
Tags soapui

In the mobile development process, due to inconsistencies in the front and back end, waiting for background development ready, often affect the work progress, and, even if the background API in place, because in the project development phase, the interface is often unstable, but also add and subtract fields and other issues. At this time, the mobile developers will need a flexible configuration of the simulation server request response tools to match their own mobile request package, there are many mock tools, such as Mock-server, Api Faker, Apimocker, etc. Some things are based on Nodejs, some are based on Java, need to deploy in the appropriate environment, more trouble, SOUPUI is a desktop testing tool, easy to install, powerful, can meet the needs of the mobile developers backstage request response requirements, this time only describes the RESTful API request response settings, He also has other functions, such as background interface test, WebService interface test, and so on, with time to be introduced in detail.

First download SOAPUI, official address: https://www.soapui.org/downloads/soapui.html,

Install the same as other Windows programs, start soapui after installation;

Right-click Projects, select New REST Project, set the requested Uri,ip, ports, resources, methods can be customized, here I set the local IP, Port is 8087;

The resulting project is as follows, we can add parameters to the request, click the plus sign, enter name and value:

Right-click on the IP and port, select the Generate REST Mock service, give the new mock service a name, click OK to generate the simulation services, the original project request has been inherited, only the new service port becomes 8089:

Double-click Response 1, write the corresponding data, pay attention to choose the correct data type, this time with the JSON:

Start the service and then you can test it:

The results are as follows, indicating that the test was successful, and the test was also successful with the mobile browser, thus implementing the request response simulation of the API service.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.