SOAPUI Tutorial for SOAP Web Service Testing

1. What is a Web Service?

A Web Service is any software code which is available over the internet and is used to transfer XML message or data using the Web Protocols like HTTP. For example., client sends a request to the server over network and specific port where Web Service is hosted and waits for response. Once the response is received, communication got completed.

1.1. Features of Web Service:

  • It uses XML for message communication.
  • It is platform independent.
  • It can be available over internet or private network.
  • It can also process complex documents and not just messages.

1.2. Types of Web Services:

There are three types of Web Services which are used for client-server communication:
  1. SOAP Web Service (Simple Object Access Protocol)
  2. REST Web Service (Representational State Transfer)
  3. WSDL (Web Service Description Language)

2. What is SOAP Protocol?

SOAP stands for Simple Object Access Protocol. It is defined by W3C standard that allows communication between two applications. Each message in this protocol contains a XML document containing data that is transferred between the client and the server.

2.1. SOAP Protocol Features

  1. It is an XML based protocol.
  2. It is language and platform independent.
  3. HTTP can be used for transporting SOAP requests and response.
  4. Messages can be broadcast using SOAP Protocol.

2.2. SOAP Message Format

A SOAP message can be a XML document which contains following elements:
  • Envelope - It defines the beginning and end of the message.
  • Header - It is optional part of the SOAP message and is used in processing the message at intermediary point or at the end point. 
  • Body - It is the actual XML message and a mandatory element.
  • Fault - It is the optional element which contains the faults or errors information which occurred during the processing of the message. There are some sub elements present for the fault:
    • <faultcode>
    • <faultstring>
    • <faultactor>
    • <detail>
Please note that all these specifications can be changed or modified with new SOAP Protocol versions. For updated specifications on SOAP Message format please refer following links: 

2.3 SOAP Message Structure Example

<?xml version="1.0"?>  
<SOAP:Envelope  
xmlns:SOAP="http://www.w3.org/2003/05/SOAP-envelope/"  
SOAP:encodingStyle="http://www.w3.org/2003/05/SOAP-encoding">  

	<SOAP:Header>  
		...  
	</SOAP:Header>  
  
	<SOAP:Body>  
		...  
	<SOAP:Fault>  
		...  
	</SOAP:Fault>  

</SOAP:Body>  
  
</SOAP:Envelope>


3. What is SOAPUI?

SOAPUI is an open source tool for testing Web Services. These services can be SOAP Web Services, RESTFUL Services or HTTP based services. SOAPUI is a very popular tool and has more than 3 million downloads. A lot of community support and knowledge is available online for this tool. There is also a commercial version available for this tool with extra functionality called READYAPI.

3.1. Types of Testing SOAPUI can perform: 

  1. Functional Testing
  2. Load Testing 
  3. Security Testing
  4. Regression Testing 
You can create a functional test and run it as a load test in SOAPUI.

3.2. Protocols & Technologies SOAPUI Supports:

  1. SOAP – Simple Object Access Protocol
  2. WSDL – Web Service Definition Language
  3. REST – Representational State Transfer
  4. HTTP – Hyper Text Transmission Protocol
  5. HTTPS – Hyper Text Transmission Protocol Secured
  6. AMF – Action Message Format
  7. JDBC – Java Database Connectivity
  8. JMS – Java Messaging Service

3.3. Installing SOAPUI

SoapUI is cross-platform and is written in JAVA, so it runs on most operating systems, It supports several Windows Versions, Mac and the multiple Linux platforms. SoapUI requires a 1.6+ version of the JRE (Java Runtime Environment), at least 1 GB of memory is recommended, and about 100 MB of disk space.

3.3.1. Installing on Linux

  1. Download the Linux binary from http://www.soapui.org/
  2. Unzip it in a directory of your choice
  3. And run $ bin/soapui.sh

3.3.2. Installing on Windows/MAC

  1. Download the installer from download for windows.
  2. Installation is pretty straight forward, start it by just double-clicking on installer.
  3. It will ask you to select destination folder, select and continue.
  4. Next step ask you to select the components you want to install, go with the default selections.
  5. On the next screen it ask you to install SOAPUI tutorials, you can add or skip it.
  6. Few more basic options will come and that's it. Finished!

4. Working with SOAPUI Interface

4.1. Main Window

  1. Main Toolbar
  2. Icons Toolbar
  3. Navigator Pane - Expandable tree display of workspace content.
  4. Properties Pane - Predefined workspace properties.
  5. Log Inspectors


4.2 Create Your First SOAP Project

  1. Click on 'New SOAP Project' to create a new project.

2. Enter name for your project.
3. Enter the WSDL file path - 

4. And click OK.
5. SOAPUI will create  the project from the WSDL provided in the navigator bar.
6. Expand the NumberToDollars and then double click on Request 1. It will display the following xml file on the right side:

7. Now you have to replace the '?' in <web:dNum>?</web:dNum> field with a number let's say 2 and press the green 'execute' arrow on top lest of the xml view.
8. And a response will be returned for this request, in the response you would see that 2 would be converted to 'two dollars' (you can select any of the two modes like xml or raw for the request and response):


Great! You just have done your first test of a SOAP Web Service using WSDL.

Similarly, you can test the remaining web service 'NumberToWords' by replacing the '?' with corresponding value and execute it and check the response.

4.3 What is a WSDL?

Coming Soon...

4.4 SOAPUI Test Case, Test Step, Test Suite, Logs Pane and Assertions

Coming Soon..

4.5 SOAPUI Properties

Coming Soon..




















    Follow Us

    YouTube Channel | Facebook Page | Telegram Channel | Quora Space
    Feel free to ask queries or share your thoughts in comments or email us.

    Comments

    Popular posts from this blog

    10+ Best Demo Websites for Selenium Automation Testing Practice

    Automate Amazon like E-Commerce Website with Selenium WebDriver

    Handle Static and Dynamic Web Table in Selenium WebDriver

    How to Automate Google Search with Selenium WebDriver

    Top 7 Web Development Trends in 2022

    50+ Most Important Selenium WebDriver Interview Questions and Answers

    25+ Most Important Selenium WebDriver Commands Tutorial

    How to Find Broken Links on Webpage with Selenium WebDriver