Sep
SOAP UI for Web Services Testing
What are Web Services?
Web services are applications that communicate over HTTP. These are used to enable data exchange between software systems. These are XML-based and are independent of a particular operating system or programming language. Software applications written in different programming languages and running on different OS can use web services to exchange data over the Internet. This interoperability is due to the use of open standards.
What are SOAP services?
SOAP i.e. Simple object access protocol is XML-based and platform independent messaging protocol used for the exchange of information over the internet. SOAP services provide an envelope for exchanging messages over the internet. These messages may include complete documents or calling of remote procedures.
What are REST services?
REST i.e. representational state transfers are JSON based web services that can be written in any programming language and executed on any platform. These are known as lightweight web services.
Restful web services are faster than Soap and consume lesser bandwidth. The different HTTP methods used for CRUD operations involved in Restful web services are:
- 1. GET is a read operation
- 2. PUT is a write/modify or update operation
- 3. POST is a create/new operation
- 4. DELETE is a delete operation
SOAP UI Services vs. REST Services
- 1. Rest services are said to be more efficient in comparison as unlike SOAP that uses only XML for all message formats, REST can use other message formats like JSON , HTML etctoo that are faster and consume lesser bandwidth.
- 2. Restful web services are faster in comparison.
- 3. SOAP UI services provide built in error handling.
- 4. SOAP being a protocol cannot use REST. On the other hand, restful web services can use any protocol like HTTP, SOAP etc.
How to use SOAP UI for testing of REST services?
Pre-Conditions:
- 1. One of the following toolSoapUI/SoapUIPro/Ready API must be installed.
- 2. Test data script shall be inserted in DB as per the requirement.
- 3. Project specific WADL and swagger ui
- 4. Security header shall be created.
Steps:
1. Open SOAP UI pro and select File> New rest project from the main menu.
2. The new WADL dialog box opens. Enter the project specific WADL and click on OK.
3. Soap UI imports the WADL and creates a new project, resulting in the following hierarchy:
The project name could be re-named meaningfully.
Any number of endpoints can be defined which one is able to switch easily in the REST request editor.
Double click on REST service node:
4. The WADL consists of operations like PUT, GET,POST. The right side of the screen displays the content for the selected operation
5. Double click on the respective operation and enter the swagger UI corresponding to it, selecting JSON only.
6. Click on execute button and the response shall be generated on the right side of the screen in JSON format if all the pre-conditions are met.
SoapUI is an open source tool for inspection of SOAP as well as REST services. Its other functionalities include mocking, load and functional testing, unit testing using assertions and data driven automation testing. This wonderful tool can also be utilised to make HTTP/HTTPS and JUDBC calls. It supports a wide variety of protocols and technologies that make it outstrip.