www.guru99.com Open in urlscan Pro
2606:4700::6813:9a5c  Public Scan

URL: https://www.guru99.com/webservice-testing-beginner-guide.html
Submission: On March 16 via api from ZA — Scanned from DE

Form analysis 1 forms found in the DOM

GET https://www.guru99.com/

<form role="search" method="get" class="search-form" action="https://www.guru99.com/">
  <label>
    <span class="screen-reader-text">Search for:</span>
    <input type="search" class="search-field" placeholder="Search …" value="" name="s">
  </label>
  <input type="submit" class="search-submit" value="Search">
  <div class="kadence-search-icon-wrap"><span class="kadence-svg-iconset"><svg aria-hidden="true" class="kadence-svg-icon kadence-search-svg" fill="currentColor" version="1.1" xmlns="http://www.w3.org/2000/svg" width="26" height="28"
        viewBox="0 0 26 28">
        <title>Search</title>
        <path
          d="M18 13c0-3.859-3.141-7-7-7s-7 3.141-7 7 3.141 7 7 7 7-3.141 7-7zM26 26c0 1.094-0.906 2-2 2-0.531 0-1.047-0.219-1.406-0.594l-5.359-5.344c-1.828 1.266-4.016 1.937-6.234 1.937-6.078 0-11-4.922-11-11s4.922-11 11-11 11 4.922 11 11c0 2.219-0.672 4.406-1.937 6.234l5.359 5.359c0.359 0.359 0.578 0.875 0.578 1.406z">
        </path>
      </svg></span></div>
</form>

Text Content

Skip to content
 * Home
 * TestingExpand
   * Agile Testing
   * JUnit
   * Quality Center(ALM)
   * Bugzilla
   * HP Loadrunner
   * RPA
   * Cucumber
   * Software Testing
   * SAP Testing
   * Database Testing
   * Mobile Testing
   * Selenium
   * ETL Testing
   * Mantis
   * SoapUI
   * JMeter
   * Postman
   * TEST Management
   * JIRA
   * QTP
   * TestLink
 * SAPExpand
   * ABAP
   * CRM
   * PI/PO
   * APO
   * Crystal Reports
   * PP
   * Beginners
   * FICO
   * SD
   * Basis
   * HANA
   * SAPUI5
   * BODS
   * HR
   * Security Tutorial
   * BI/BW
   * MM
   * Solution Manager
   * BPC
   * QM
   * Successfactors
   * CO
   * Payroll
   * SAP Courses
 * WebExpand
   * Apache
   * Java
   * PHP
   * SQL Server
   * AngularJS
   * JSP
   * PL/SQL
   * UML
   * ASP.NET
   * Kotlin
   * PostgreSQL
   * VB.NET
   * C
   * Linux
   * Python
   * VBScript
   * C#
   * MariaDB
   * ReactJS
   * Web Services
   * C++
   * MS Access
   * Ruby & Rails
   * WPF
   * CodeIgniter
   * MySQL
   * Scala
   * SQLite
   * DBMS
   * Node.js
   * SQL
   * Perl
   * JavaScript
 * Must LearnExpand
   * Accounting
   * Embedded Systems
   * Operating System
   * Algorithms
   * Ethical Hacking
   * PMP
   * Android
   * Excel Tutorial
   * Photoshop
   * Blockchain
   * Go Programming
   * Project Management
   * Business Analyst
   * IoT
   * Reviews
   * Build Website
   * ITIL
   * Salesforce
   * Cloud Computing
   * Jenkins
   * SEO
   * COBOL
   * MIS
   * Software Engineering
   * Compiler Design
   * Movie
   * VBA
   * Courses
   * Networking
   * VPN
 * Big DataExpand
   * AWS
   * Hive
   * Power BI
   * Big Data
   * Informatica
   * Qlikview
   * Cassandra
   * MicroStrategy
   * Tableau
   * Cognos
   * MongoDB
   * Talend
   * Data Warehousing
   * NiFi
   * ZooKeeper
   * DevOps
   * OBIEE
   * Pentaho
   * HBase
 * Live ProjectExpand
   * Live Agile Testing
   * Live Selenium Project
   * Live HP ALM
   * Live Selenium 2
   * Live Java Project
   * Live Security Testing
   * Live Mobile Testing
   * Live Testing Project
   * Live Payment Gateway
   * Live Testing 2
   * Live PHP Project
   * Live Telecom
   * Live Projects Hub
   * Live UFT/QTP Testing
   * Live Python Project
   * Live SEO Project
 * AIExpand
   * Artificial Intelligence
   * PyTorch
   * Data Science
   * R Programming
   * Keras
   * TensorFlow
   * NLTK

Search
Toggle Menu


WEB SERVICES TESTING TUTORIAL: HOW TO TEST? LEARN WITH EXAMPLE

ByThomas Hamilton Hours UpdatedFebruary 18, 2023


WHAT IS WEBSERVICE?

Web Services is the mechanism or the medium of communication through which two
applications / machines will exchange the data irrespective of their underline
architecture and the technology.


WHAT IS WEB SERVICE TESTING?

Web Services Testing is a type of software testing that validates Web services.
The purpose of Web Services Testing is to check the functionality, reliability,
performance, and security of an API(Application Program Interface). Web Service
Testing is similar to unit testing in some cases. You can test a Webservice
manually or create your own automation code or use an off-the shelf automation
tool like Postman.


WHY IS WEBSERVICE NEEDED?

In general, software applications are developed to be consumed by the human
beings, where a person sends a request to a software service which in-turn
returns a response in human readable format.

In the modern era of technology if you want to build a software application you
don’t need to build each and everything from scratch. There are lots of
readymade services available which you can plug into your application and you
can start providing those services in your application.

For example 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 who already well-established in processing and
publishing such kind of data.

Web services allow us to do these kind of implementations.

As an example, consider the following WebService



http://www.webservicex.net/stockquote.asmx?op=GetQuote

It gives Share Value for a Company.

Let’s find share price for Google (Symbol: GOOG )



The response XML gives the stock price.



This WebService can be called by a Software Application using SOAP or HTTP
protocol.


WEB SERVICE PROTOCOLS

Web Services can be implemented in different ways, but the following two are the
popular implementations approaches.

 1. SOAP (Simple Object Access Protocol)
 2. REST (Representational State Transfer architecture)


SOAP

SOAP is a standard protocol defined by the W3C Standard for sending and
receiving web service requests and responses.

SOAP uses the XML format to send and receive the request and hence the data is
platform independent data. SOAP messages are exchanged between the provider
applications and receiving application within the SOAP envelops.

As SOAP uses the simple http transport protocol, its messages are not got
blocked by the firewalls.


REST

REST means REpresentational State Transfer; it is an architecture that generally
runs over HTTP. The REST style emphasizes the interactions between clients and
services, which are enhanced by having a limited number of operations. REST is
an alternative to SOAP (Simple Object Access Protocol) and instead of using XML
for request REST uses simple URL in some cases. Unlike SOAP, RESTFUL
applications uses HTTP build in headers to carry meta-information.

There are various code that REST use to determine whether user has access to API
or not like code 200 or 201 indicates successful interaction with response body
while 400 indicates a bad request or the request URI does not match the APIs in
the system. All API request parameters and method parameters can be sent via
either POST or GET variables.

Rest API supports both XML and JSON format for WebServices API Testing. It is
usually preferred for Mobile and web apps as it makes app work faster and
smoother


WSDL

WSDL (Web Services Description Language) is an XML based language which will be
used to describe the services offered by a web service.

WSDL describes all the operations offered by the particular web service in the
XML format. It also defines how the services can be called, i.e what input value
we have to provide and what will be the format of the response it is going to
generate for each kind of service.


HOW TO TEST A WEB SERVICE?

To test web service, you can

 1. Test Manually
 2. Create your own Automation Code
 3. Use an off-the shelf automation tool like SoapUI.

Web Services Automation Testing involves following steps –

 1. Understand the WSDL file
    
 2. Determine the operations that particular web service provides
    
 3. Determine the XML request format which we need to send
    
 4. Determine the response XML format
    
 5. Using a tool or writing code to send request and validate the response
    

Suppose we want to test web service which provides Currency Conversion Facility.
It will the current conversion rates between the different countries currency.
This service we can use in our applications to convert the values from one
currency to the other currency.

Now lets look at above steps


STEP 1 TO 4: UNDERSTANDING WSDL AND DETERMINING OPERATIONS & XML FORMATS

Currency Convertor WSDL file can be seen @
(http://www.webservicex.net/CurrencyConvertor.asmx?wsdl) which will give the
information about the Currency Convertor web service methods which it will
support, the parameter which we need pass and the type of parameters… etc.






STEP 5: USING A TOOL OR WRITING CODE TO SEND REQUEST AND VALIDATE THE RESPONSE

There are lots of WebService Test tools available to test SOAP web service.
SoapUI is one of the popular API tool which will help us to test SOAP 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 against the expected result. In
this Web Services Testing tutorial, we will test the WebService

 1. Using Java
 2. Using SoapUI


PART 1) WEBSERVICE TESTING USING APACHE AXIS2 API (JAVA).

Generally web service takes the request and sends the response in the XML
format.

Apache Axis2 API project is a Java implementation API, which will be used to
create the Web services for both server side (service provider) and client side
(service consumer).

Axis2 is capable of sending SOAP messages and Receives & Processes the SOAP
messages. We can write a small Java program using the API to create the web
service. Axis2 will generate the WSDL from Java program which will be used to
communicate the services offered by the web service. We can use the same Axis2
to generate the Java class (stub) from WSDL file which we can use as a client
program to generate the web service request, to send the request to the service
end point and to process the response.

 1. Basically we will create a simple Java program in which we will instantiate
    the stub class.
 2. Using the stub we will invoke the request method by passing all the required
    information.
 3. Stub program will convert that request into XML request format and sends it
    the service end point which will read the request and processes the request
    and sends the response in XML format.
 4. The XML response will be converted into Java class by stub and returned to
    the actual program.

Let’s look at above steps in detail

Step a) Download the axis2 API @
https://axis.apache.org/axis2/Java/core/download.cgi & Set the environment
variable ‘AXIS2_HOME’





Step b) Create a folder to keep all the generated artifacts

Ex : C:\Axis\Projects\CurrencyConverter

Step c) Open the command prompt and navigate to the folder structure where you
want to generate the artifacts and Run the following command which will generate
the stubs

%AXIS2_HOME%\bin\WSDL2Java -uri
http://www.webservicex.net/CurrencyConvertor.asmx?wsdl -p
org.apache.axis2.currencyconvertor -d adb –s



Step d) Once the command is successfully run, you will see the folder with
required files.



Step e)In the next step of this Web Services Testing tutorial, we have to create
the client program, through which we will send the actual request using the
generated stubs. Open the eclipse and create the new Java project and select the
folder which we have created above.



Step f) Add all the axis2 related jars to project build path, which will be
there in lib folder of the axis2 software folder

(for ex : C:\Axis\axis2-1.6.2\lib)



Step g) Create a new Java class (ex : Client.Java) and instantiate stub object.
Using the stub object we can call all the supported methods of the particular
WebService.



Client.Java Program
package org.apache.axis2.currencyconvertor;
import org.apache.axis2.currencyconvertor.CurrencyConvertorStub.ConversionRate;
import org.apache.axis2.currencyconvertor.CurrencyConvertorStub.ConversionRateResponse;
import org.apache.axis2.currencyconvertor.CurrencyConvertorStub.Currency;

public class Client {
 public static void main(Java.lang.String args[]) {

  try {

       //Create the stub object by passing the service end point url
       CurrencyConvertorStub stub = new CurrencyConvertorStub("http://www.webservicex.net/CurrencyConvertor.asmx");
       //ConversionRate is the class which we have to use mention the from and to currency
       //ConversionRate object will be the parameter for the conversionRate operation
       ConversionRate conversionRate = new ConversionRate();
       conversionRate.setFromCurrency(Currency.USD);
       conversionRate.setToCurrency(Currency.INR);

       //Create the ConversionRateResponse object, which is going to be used to catch the response
       //call the conversionRate service using the stub object
       ConversionRateResponse conversionRateResponse = stub.conversionRate(conversionRate);

       //We can use the conversionRateResponse object to retrieve the response of the ConversionRate Service
       System.out.println("Conversion Rate from INR to USD : " + conversionRateResponse.getConversionRateResult());

       } catch (Exception e) {
       e.printStackTrace();
      }
    }
}



PART 2) HOW TO TEST USING SOAPUI WEB SERVICE

In SoapUI

 1. Go to File > New Soap Project
 2. Enter the project Name and the WSDL URI location
 3. Click OK



 1. Expand the first request and double click on the ‘Request1’. It will display
    the SOAP request in the XML format.
 2. Enter the From Currency and To Currency
 3. Click on the submit button
 4. Response XML will be displayed right side pane.



As you may conclude, usage of WebService Test tools like SoapUI expedites your
Web Services Automation Testing Effort. Hence SoapUi will be focus of our
learning in the succeeding tutorials.


SUMMARY

 * Software Applications communicate and exchange data with each other using a
   WebService
 * SOAP and REST are 2 popular protocols to create a WebService
 * SOAP supports XML based data exchange
 * REST support XML, Json or exchange of data in simple URL for WebServices API
   Testing.
 * WSDL is XML based language which will be used to describe the services
   offered by a web service. SOAP is defined using WSDL.
 * To test WebService you can
   * Create your own code. For instance use Axis2 API for Java
   * Use WebService Test Automation tools like SoapUI
 * Automation Tools like SoapUI will jumpstart your Web Services Automation
   Testing efforts, will require less coding effort compared to creating your
   own code using Axis2 API


FAQ

What is Difference between WebService and WebAPI?



Web Service Web API
 * Defined by W3C, all communication & data exchange is based on XML

 * Web API communication & data exchange could be XML, JSON or plain data

 * It has defined standards – WSDL

 * No defined standard

 * You cannot compress the data but you can compress the HTML request

 * You can compress the data

 * Example: SOAP

 * Example: REST

Learn more about Web API Testing

This Web Services Testing tutorial is made possible with contributions of Mr.
Narender Reddy Nukala


YOU MIGHT LIKE:

 * SoapUI Tutorials for Beginners
 * What is SoapUI? Introduction to SoapUI Testing
 * SOAPUI Download, Install, & Configuration on Windows
 * How to create Test Suite & Test Case in SoapUI
 * Assertions in SoapUI: Scripts, XQuery, XPath Types Tutorial


POST NAVIGATION

Report a Bug
Previous Prev
NextContinue




TOP TUTORIALS


About
About Us
Advertise with Us
Write For Us
Contact Us

PYTHON

TESTING

HACKING

Career Suggestion
SAP Career Suggestion Tool
Software Testing as a Career

Interesting
eBook
Blog
Quiz
SAP eBook


SAP

JAVA

SQL

Execute online
Execute Java Online
Execute Javascript
Execute HTML
Execute Python


SELENIUM

BUILD WEBSITE

VPNS



© Copyright - Guru99 2023         Privacy Policy  |  Affiliate
Disclaimer  |  ToS

Scroll to top Scroll to top

 * Home
 * TestingExpand child menuExpand
   * Agile Testing
   * JUnit
   * Quality Center(ALM)
   * Bugzilla
   * HP Loadrunner
   * RPA
   * Cucumber
   * Software Testing
   * SAP Testing
   * Database Testing
   * Mobile Testing
   * Selenium
   * ETL Testing
   * Mantis
   * SoapUI
   * JMeter
   * Postman
   * TEST Management
   * JIRA
   * QTP
   * TestLink
 * SAPExpand child menuExpand
   * ABAP
   * CRM
   * PI/PO
   * APO
   * Crystal Reports
   * PP
   * Beginners
   * FICO
   * SD
   * Basis
   * HANA
   * SAPUI5
   * BODS
   * HR
   * Security Tutorial
   * BI/BW
   * MM
   * Solution Manager
   * BPC
   * QM
   * Successfactors
   * CO
   * Payroll
   * SAP Courses
 * WebExpand child menuExpand
   * Apache
   * Java
   * PHP
   * SQL Server
   * AngularJS
   * JSP
   * PL/SQL
   * UML
   * ASP.NET
   * Kotlin
   * PostgreSQL
   * VB.NET
   * C
   * Linux
   * Python
   * VBScript
   * C#
   * MariaDB
   * ReactJS
   * Web Services
   * C++
   * MS Access
   * Ruby & Rails
   * WPF
   * CodeIgniter
   * MySQL
   * Scala
   * SQLite
   * DBMS
   * Node.js
   * SQL
   * Perl
   * JavaScript
 * Must LearnExpand child menuExpand
   * Accounting
   * Embedded Systems
   * Operating System
   * Algorithms
   * Ethical Hacking
   * PMP
   * Android
   * Excel Tutorial
   * Photoshop
   * Blockchain
   * Go Programming
   * Project Management
   * Business Analyst
   * IoT
   * Reviews
   * Build Website
   * ITIL
   * Salesforce
   * Cloud Computing
   * Jenkins
   * SEO
   * COBOL
   * MIS
   * Software Engineering
   * Compiler Design
   * Movie
   * VBA
   * Courses
   * Networking
   * VPN
 * Big DataExpand child menuExpand
   * AWS
   * Hive
   * Power BI
   * Big Data
   * Informatica
   * Qlikview
   * Cassandra
   * MicroStrategy
   * Tableau
   * Cognos
   * MongoDB
   * Talend
   * Data Warehousing
   * NiFi
   * ZooKeeper
   * DevOps
   * OBIEE
   * Pentaho
   * HBase
 * Live ProjectExpand child menuExpand
   * Live Agile Testing
   * Live Selenium Project
   * Live HP ALM
   * Live Selenium 2
   * Live Java Project
   * Live Security Testing
   * Live Mobile Testing
   * Live Testing Project
   * Live Payment Gateway
   * Live Testing 2
   * Live PHP Project
   * Live Telecom
   * Live Projects Hub
   * Live UFT/QTP Testing
   * Live Python Project
   * Live SEO Project
 * AIExpand child menuExpand
   * Artificial Intelligence
   * PyTorch
   * Data Science
   * R Programming
   * Keras
   * TensorFlow
   * NLTK

Toggle Menu Close
Search for:
Search