This document provides an overview of SOAPUI and web services testing. It discusses what SOAPUI is, how to create a SOAPUI project, how to make requests and validate responses, and features of SOAPUI like assertions and load testing. Key elements of web services like WSDL, UDDI, SOAP, and the message flow in SOAPUI are also explained. RESTful services are compared to SOAP briefly. Real world examples of using weather and news APIs are also provided.
2. 2
What is SOAPUI.?
What is a web service.?
Architecture of Web services.
Elements of web services.
Message flow in SOAPUI.
How to create a SOAP UI project and start testing.
Validating results and adding assertions.
Features of SOAPUI.
Real world examples
SOAP VS RESTful
Q&A
Agenda
3. 3
SoapUI is a free and open source cross-platform Functional Testing solution to test
web services. With an easy-to-use graphical interface , SoapUI allows you to easily
and rapidly create and execute automated functional, regression, security, and
load tests.
SoapUI provides complete test coverage and supports all the standard protocols
and technologies.
Automated testing solution including: data driven tests, load tests, scenario-
based tests.
Built-in reporting capabilities
What is SOAPUI ?
4. 4
SOAP is an XML-based protocol to let applications exchange information over
HTTP.
◦ SOAP stands for Simple Object Access Protocol
◦ SOAP is a communication protocol
◦ SOAP is a format for sending messages
◦ SOAP is platform independent:Java can talk with Perl; Windows applications can talk with Unix applications
◦ SOAP is language independent
Where to find SOAPUI tool ?
https://www.soapui.org/downloads/soapui.html
What is SOAPUI continued…
5. 5
A web service is a method of communication between two electronic devices
over the World Wide Web. A web service is a software function provided at a
network address over the web or the cloud, it is a service that is "always on“.
Web services allows you to expose the functionality of your existing code
over the network. Once it is exposed on the network, other application can
use the functionality of your program.
There are lots of tools available to test web services. SoapUI is one of the
popular tools (other is Apache Axis2) which will help us to test the web
services. In fact you can use the any programing language which is capable of
sending the XML request to the web service provider application over the
http and able to parse and validate the response XML
What is a webservice ?
6. 6
Layered Architecture.
Service Transport
This layer is responsible for transporting messages between applications. Currently, this layer includes Hyper
Text Transport Protocol (HTTP), Simple Mail Transfer Protocol (SMTP), File Transfer Protocol (FTP).Mostly we use
HTTP.
XML Messaging
This layer is responsible for encoding messages in a common XML format so that messages can be understood
at either end. Currently, this layer includes XML-RPC and SOAP.
Service Description
This layer is responsible for describing the public interface to a specific web service. Currently, service
description is handled via the Web Service Description Language (WSDL).
Service Discovery
This layer is responsible for centralizing services into a common registry and providing easy publish/find
functionality. Currently, service discovery is handled via Universal Description, Discovery, and Integration (UDDI).
Architecture of web services
7. 7
Webservices consists of 4 main elements:
WSDL:
WSDL is an XML-based language for describing web services , how to access them , parameters
each operation accepts.
WSDL stands for Web Services Description Language.
WSDL was developed jointly by Microsoft and IBM.
WSDL is an XML based protocol for information exchange in decentralized and distributed
environments.
WSDL is the standard format for describing a web service.
WSDL definition describes how to access a web service and what operations it will perform.
WSDL is an integral part of UDDI, an XML-based worldwide business registry.
Elements of webservices .
8. 8
UDDI:
UDDI is an XML-based standard for describing, publishing, and finding web
services.
UDDI stands for Universal Description, Discovery, and Integration.
UDDI is a specification for a distributed registry of web services.
UDDI is platform independent, open framework..
UDDI uses WSDL to describe interfaces to web services.
UDDI is an open industry initiative enabling businesses to discover each other
and define how they interact over the Internet.
Elements of webservices…
continued
9. 9
Service Provider or Publisher
This is the provider of the web service. The service provider implements the
service and makes it available on the Internet or intranet via UDDI.
Service Requestor or Consumer
This is any consumer of the web service. The requestor utilizes an existing
web service by opening a network connection and sending an XML request.
This is where SOAPUI comes into picture !
Elements of webservices…
continued
12. 12
SoapUI structures functional tests into three levels; TestSuites, TestCases and TestSteps.
Project structure in SOAPUI ?
CREATE SOAPUI PROJECT
Create Test Suite
Create Test Cases
Create steps
13. 13
Prerequistes: SoapUI is installed on your machine.
Step1. Go to File-> New soapUI Project.
How to create a SOAP UI project
14. 14
Step2. In the Add WSDL dialog enter
http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL.
And then Click OK.
.
How to create a SOAP UI project
15. 15
Step3. Now see that the WSDL
was successfully added to the
project by seeing the
operations/services by
expanding the project.
How to create a SOAP UI project
16. 16
Step 4. To Create a request from your WSDL,Click on the plus sign next to the web
service in the navigator to expand. But usually we don’t run from the WSDL but we
create test suite and then call this request as a test case.
NN
How to create a SOAP UI project
Step 5. Double click on the request.
17. 17
How to create a SOAP UI project
Step 6 : Run a request to the webservcie by clicking on the Green arrow head .
18. 18
Validating results and adding assertions
Step 6 : Validate the response on the right side window knows as response window..
19. 19
Validating results and adding assertions
Now that we have the response but how can SOAPUI be sure that it’s the
expected result. So we have to add a validation to the response. In SOAPUI this
is called as “Adding an assertion”.
For an example:
Simple Contains: If response contains a particular expected text/number etc. We
can say its passed. Lets say if response contains 200 OK,I will consider my test
case to be passed.
Response SLA: If response is within a pre defined time limit, We can say its
passed. Lets say if response is within 200ms or 2 seconds, I will consider my test
case to be passed.
20. 20
It can also be used as Load testing and security testing tool.
For load testing.
-From Load test case which is created by default under the Test suite.
-Configure your load test
-Run it and observe the output.
Features of SOAPUI.
21. 21
RESTful web services are light weight, highly scalable and maintainable and
are very commonly used to create APIs for web-based applications.
In REST architecture, a REST Server simply provides access to resources
and the REST client accesses and presents the resources. Here each
resource is identified by URIs/ Global IDs. REST uses various
representations to represent a resource like Text, JSON and XML. JSON is
now the most popular format being used in Web Services.
The following HTTP methods are most commonly used in a REST based
architecture.
GET − Provides a read only access to a resource.
PUT − Used to create a new resource.
DELETE − Used to remove a resource.
POST − Used to update an existing resource or create a new resource.
SOAP vs REST
22.
23. 23
1. If you want to display weather forecast information you don't
need to collect, process and render the data in your application.
You can buy the services from the people (weather.com,
timeanddate.com etc) who already well-established in processing
and publishing such kind of data.
2.Timesofindia.com shows current temperature of your city.
https://services.timeanddate.com
3.Google.com example as HTTP request.
Real world examples
Notas del editor
Give example of TOI and Time and Date.
Search and show the webservices of time and date
An example on google API for Rest webservices
http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false