We suggest that our readers should start learning SoapUI – the most used web services API testing tool, with this SoapUI tutorials series.
Since this is a highly technical and a somewhat specialized form of testing we are talking about, it is important that we lay some ground work that will lead the way to easily mastering the concepts.
Here is what you will learn in this comprehensive SoapUI Tutorial series:
- Tutorial #1: Understanding Web services (must read)
- Tutorial #2: Features of SoapUI & SoapUI Pro
- Tutorial #3: Installation of SoapUI and SoapUI Pro
- Tutorial #4: Working with Projects (must read)
- Tutorial #5: Understanding Assertions in SOAPUI
- Tutorial #6: Working with Operators
- Tutorial #7: Dealing Properties with Groovy Script (must read)
- Tutorial #8: Working with Properties
- Tutorial #9: Conditional Statements in Groovy
- Tutorial #10: Object Oriented Concepts
- Tutorial #11: Exception Handling in Groovy
SoapUI Pro Tutorials:
- Tutorial #12: Introducing SoapUI Pro (must read)
- Tutorial #13: Understanding REST and SOAP Services (must read)
- Tutorial #14: Understanding Data Driven Testing
- Tutorial #15: Storing Request and Response in a File (must read)
- Tutorial #16: SoapUI Interview Questions and Answers
In this process here in this tutorial, we are going to discuss web services in detail.
Nowadays web services play a major role in Internet applications. Let us now take some time for a brief introduction of the web services. For enhanced expertise in web services knowing HTML and XML mark up languages is important as the Web Services are created and implemented with via these languages.
What are Web Services?
Web services are web components that transfers data between client and server. Client sends a web request to the server and the server then responds to client. This response will differ based on the web service request type.
Web services in SoapUI:
SoapUI is designed for validating web services easily.
Let’s look at an example: A flight ticker booking application that runs in City 1 and is being accessed from City 2 to book a ticket. A user enters all the information such as boarding point, destination point, date of journey etc, and then as soon as the “Book Now” button is clicked, the web service from City 1 gets invoked and it passes all the information that is entered to the application server that processes the user request. The Reservation application will then send a response to the User’s request.
Most of the online payment transactions are processed through web services only because of the enhanced security this method offers. An input parameter will be sent to the payment gateway website and which would be processed subsequently. An acknowledgement will be sent to the client regarding payment status finally.
All these activities can be seen through SoapUI request and response screens. SoapUI helps us to evaluate these web services.
Now let’s see the important components of the web services. They are,
- WSDL – Web Service Description Language
- SOAP – Simple Object Access Protocol
- UDDI – Universal Description, Discovery and Integration
- RDF – Resource Description Framework
#1. WSDL (Web Services Description Language):
A WSDL is a document that should be written using XML. This document describes the following details about the web service:
- Origin of the web service
- Header information
- Port type
- Input and output messages
Each of the above information is represented as a tag in the WSDL file, such as:
- <types> – XML Schema data types
- <message> – the actual request and response data being communicated
- <portType> – the target / end points where the actual web service is hosted to perform the operation
- <binding>– the protocol information is given for the data format
- <definitions>– the parent tag for the above mentioned tags
Now let’s look at a sample WSDL file:
Your WSDL file should follow the W3C standard as above. Through web services we can convert into web based application. Web services are constructed on top of XML, HTTP, TCP / IP, Java, HTML and so on. Since web services are XML based language so that we can have these applications as local, distributed and web based environments.
Role of WSDL:
Validating web services using SoapUI is easy and is only possible with WSDL document because to configure web services in SoapUI, WSDL document is mandatory. If the WSDL document is not valid, SoapUI will throw an exception immediately. Now let us look at UDDI component.
#2. UDDI (Universal Description, Discovery and Integration):
This is a global repository where we can search the web services spread over the globe. In order to get or search web services just visit http://uddi.xml.org/ web site. Here you can also register your own web service and make it available to global users.
UDDI is the place where the WSDL is described in detail. This will communicate through the SOAP protocol which will be explored later in this tutorial. Say for example, if you wish to advertise your products to the global customers you could create a web service and host it through UDDI. This can now be accessed by global users and from there the business could be established.
#3. SOAP (Simple Access Object Protocol):
Generally, it uses XML based data to interact with web applications.
Here are some points to remember:
- SOAP is language and platform independent as it is written by using XML.
- It creates the platform to communicate with the applications that are running in different operating systems using different technologies.
- Most of the Internet applications interact with each other over Remote Procedure Calls that use DCOM (Distributed Component) and CORBA (Common Broker Architecture)
- These technologies are different than the HTTP.
RPC (Remote procedure calls) are sometimes blocked by firewalls and proxy servers. To overcome these issues, SOAP was designed. There are some standard rules to be followed while building SOAP requests.
Let’s take a look at sample SOAP document.
As you can see, a SOAP document must contain the following elements:
- Envelope element is the top most tag which identifies the XML document as a SOAP message.
- Followed by Envelope element, you see the header element that has header information.
- The Body element specifies the call and response information.
- Finally, you have a Fault element which contains errors and status information.
The above said elements should be declared with default namespace for the SOAP envelope.
Generally, a protocol is a set of standard rules that transfers the data between two regions in the Internet over the web services. There are many protocols that are used in the Internet applications. They are, Transmission Control Protocol (TCP) which serves as a packet between two connections. Internet Protocol (IP) that sends and receives the messages between two destinations.
Let us see some other important protocols:
- Hyper Text Transfer Protocol (HTTP)
- File Transfer Protocol (FTP)
- Border Gateway Protocol (BGP) and
- Dynamic Host Configuration Protocol (DHCP)
These protocols are used according to the requirements.
#4. RDF (Resource Description Framework):
RDF contains the description of the web resources such as title, author, content, and copyright information. This framework was designed so that computers can be read and understood easily by the web.
RDF is completely written by using XML language.
RDF data can be transferred between different types of computers using different operating systems and programming languages. Generally, RDF uses Uniform Resource Identifiers (URIs) on the web and it describes the resources along with the property and property values.
Take a look at the sample RDF document to understand better:
<? xml version="1.0"?> <RDF> <Description about="http://www.softwaretestinghelp.com/rdf"> <author> Wilfred R. Myers </author> <homepage>http://www. softwaretestinghelp.com</homepage> </Description> </RDF>
What is XML?
XML (eXtensible Markup Language) is a mark-up language that is used for storing, sharing and formatting data. In general, an XML document is built by the tags. Let us see the sample XML content for a user’s personal information.
<Firstname> Joel </Firstname>
<Lastname> King </Lastname>
<Address> 1432 Valley Drive </Address>
<City> New York </City>
<Country> United States </Country>
<Zipcode> 19714 </Zipcode>
Meaning of “eXtensible” and “Markup”:
In the above sample, First name, Last name, Address etc. are enclosed by less than (<) and greater than (>) symbols. These labels are known as tags and the one with forward slash (/) along with the text, that is called closing tag. Tags are also called as mark-ups. These are customized as needed. This customization is not possible in other mark-up languages like SGML, HTML and so on. This is why XML is an extensible language.
XML focuses on the data for storing, sharing and exchanging as required, and HTML deals with the format of the data like applying colours, adding images, changing fonts, styles and so on.
XML and HTML can be used together in applications. For example, if you take a book, there will be textual data and graphical representation formatted. Hypothetically, XML can handle storing actual data and HTML applies the format for the content. Thereby the text book could have information as well as attractive images and colours.
How XML works with SoapUI?
As XML is a common language on Internet, it can be integrated with SoapUI because web services are mostly written in the form of XML. Also, if we pass XML input parameter to the web service, the response itself will be in the form of XML. SOAPUI can configure these web services
So far in this tutorial, we took a look at:
- Web services and its several components like WSDL, UDDI, RDF SOAP
- Importance of WSDL document and its body of content
- XML and its usages in SoapUI
Next tutorial => In the next topic, we will learn the features of SoapUI and SoapUI Pro version in detail.
About the authors: Karunagara Pandi and Swati Seela are helping us to deliver this comprehensive series of SoapUI and SoapUI pro tutorials. Karunagara is having 10+ years of IT and Software Testing experience on Automation and Manual testing projects. He has completed master degree in computer applications. Swati Seela, STH team member, is also helping us to make sure this is the most up to date and useful series for our readers.
Feel free to post all your queries about web services and SoapUI tool. We will answer all these questions in the coming tutorials.
Here is the list again.
SoapUI and SoapUI Pro Tutorials:
SoapUI Free Version:
Tutorial #1. Understanding Webservices
– What are Webservices?
– What is the role of WSDL in SoapUI?
– Understanding XML
Tutorial #2. Features of SoapUI & SoapUI Pro
– SoapUI Pro
Tutorial #3. Installation of SoapUI and SoapUI Pro
Tutorial #4. Working with Projects
– Creating Projects in SoapUI
– Adding Testsuite, Testcase and Teststep
– Cloning Objects of Project
– Renaming and Deleting Project Elements
Tutorial #5. Understanding Assertions in SOAPUI
– Brief Introduction of Assertions
– Contains and Not Contains Assertions
– XPath Assertions
– XQuery Assertions
Tutorial #6. Working with Operators
– Glance At Groovy Scripting
– Working with Arithmetic Operations
– Understanding Unary Operators
– Using Assignment Operators
Tutorial #7. Dealing Properties with Groovy Script
– Assigning Data to Properties
– Accessing Test Results From Properties
– Understanding Property Test Step
Tutorial #8. Working with Properties
– Different Faces of Properties
– Integrating Properties in Service Request
– Understanding Property Transfer Teststep
– Load Properties Externally
Tutorial #9. Conditional Statements in Groovy
– Boolean Statements
– Iteration Statements
– Arrays in Groovy
Tutorial #10. Object Oriented Concepts
– Basic Introduction of OOP
– Methods with Global Properties
– Methods with ‘Return’ keyword
– Methods with Arrays
Tutorial #11. Exception Handling in Groovy
– Brief Introduction of Exception and Its Types
– Importance of Exception Handling in SoapUI
– Explaining Exception Handling with Example
SoapUI Pro Version
Tutorial #12. Introducing SoapUI Pro
Tutorial #13. Understanding REST and SOAP Services
Tutorial #14. Understanding Data Driven Testing
– Understanding Data Driven Testing
– Brief introduction of data driven testing and types
– Datasource and Datasource loop test steps
– Storing and Reading From XLS and XML
Tutorial #15. Storing Request and Response in a File
Tutorial #16. Top 30+ SoapUI Interview Questions