Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Comparative Study of REST and SOAP: Case of

Registrar of Political Parties Kenya


Christopher Kiama1, Lawrence Muchemi2
School of Computing and Informatics
University of Nairobi, Kenya
Email: cwkiama@gmail.com1, lmuchemi@uonbi.ac.ke2

Abstract
This research is a comparative study of Representational State Transfers (REST) and Simple Object Access
protocol (SOAP). The research is an objective experimental study that investigates how REST compares to
SOAP web services in terms of performance, scalability, maintainability and extensibility. Two prototypes
one for each web service were developed that consolidate data from different sources into the same
database tables. Data from registrar of political parties of Kenya was presented from MYSQL database via
the web services in the forms of HTML, XML and JavaScript Object Notation (JSON) using the common
browsers.
On average from the experiments performed in this research, Performance results indicated by the amount
of time taken to pull data from the server and the memory required to finish the process, shows that SOAP
web services takes approximately over one and half times memory required by REST and about 3 times the
amount of time needed to fetch the same data from the same database table. However scalability measured
via throughput values (Kbps) against number of users accessing the same data at the same time, indicates
that both REST and SOAP scale almost evenly but with REST having a slightly higher throughput with the
increase in number of users.

Keywords (TXT) and XLS. The two web services will


SOAP, REST, Scalability, web service, help in determining the how well web
performance, extensibility. applications will improve in performance,

1.0 Introduction scalability and extensibility.

In recent decades, systems developed using Representational State Transfer (REST)

web for concurrent information access has marks software architecture pattern (in

been a major issue as far as performance, contrast to SOAP which is a protocol). It

scalability and extensibility are concerned. relies on a stateless, client-server, cacheable

This research which is a case of Registrar of communications protocol and in virtually all

political parties, the body charged with the cases; the HyperText Transfer Protocol

responsibility of registering political parties (HTTP) protocol is used.

before going for elections in Kenya has used REST and SOAP uses a simple HTTP-based

Web service technologies (REST and protocol that enables users to contact the

SOAP) to collect data / information from message broker through a Web browser by

political parties data stores; in the forms of navigating to appropriately formatted

comma separated values (CSV), Text files Uniform Resource Locator (URL) or by

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 105


posting HyperText MarkUp Language while REST consumes less bandwidth
(HTML) forms based on a subset of the because its response is lightweight.
HTTP protocol [2].
In the development of prototypes using
SOAP stands for Simple Object Access REST and SOAP, a research is done to
Protocol and brings its own protocol and determine the best web service in terms of
focuses on exposing pieces of application scalability, performance, extensibility and
logic (not data) as services. It exposes efficiency in solving the main problem of
operations and is focused on accessing the registrar of political parties.
named operations through different Extensibility is the ability of the prototype
interfaces. system to allow and accept significant
Though SOAP is commonly referred to as extension of its capabilities, functionality,
web services it has very little if anything enhancement for the purpose of meeting
to do with the Web but REST provides true future needs and significantly changing
Web services based on URIs and HTTP. requirements without major rewriting of
code or changes in its basic architecture [8].
SOAP is not made for resource constrained Scalability is the ability of the prototype
mobile devices but it is for fixed network. architecture to grow to accommodate
The SOAP messages has heavy payload. In increasing number of users, applications and
contrast, the REST messaging framework system [6].
has lightweight payload which is suitable for The objectives of this research are:
mobile as well as cellular network. REST 1. Design frameworks that Combine
identifies the service resources by single Registrar of political parties data
URL only [5]. from different data sources and use
SOAP request uses POST and require a REST and SOAP frameworks to
complex XML request to be created which present it through a browser.
makes response-caching difficult While 2. Develop prototypes that use
RESTful APIs can be consumed using simulated political parties data
simple GET requests, intermediate proxy based on HTTP web service on
servers / reverse-proxies can cache their REST and SAOP principles that
response very easily. demonstrates the framework in
SOAP consumes more bandwidth because objective one.
its response could require more than 10
times as many bytes as compared to REST

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 106


3. Evaluate and compare the in CSV, TXT and XLS formats; the
prototypes based on REST and simulated data is presented in parties and
SOAP frameworks. members tables.
4. Recommend the most suitable
framework for political parties 2.2 Designs frameworks
problem in terms of performance, The research is a comparative study of
scalability extensibility and REST and SOAP; two prototype designs are
maintenance. designed, implemented and comparatively
comparing the results of the experiments
1.1 Scope of the research done.
This research involves designing of frame
works and come up with prototypes that
combine and works with data using REST
and SOAP web services. This will enable
and guide the registrar of political parties in
analyzing and determine presentation of
each political party in every county. The
consolidation of data will be limited to SQL
databases using TXT, CSV files and
spreadsheet formats.
SOAP framework
2.0 Approach
2.1 Data sources and preparation FIGURE 1: MODEL FRAMEWORK OF SOAP
The prototypes are based on political
parties simulated data, which is presented

REST framework

HTTP
Client Service

Option 2: A RESTful service provides a client library Clients see methods with parameters

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 107


A
HTTP
Client P Service
Regardless of how the HTTP server to be
I used is configured, server-side code needs to
be written that is responsible for handling
FIGURE 2: MODEL FRAMEWORK OF REST incoming service requests and formulating
appropriate responses.
2.3 SOAP Implementation
SOAP uses WSDL file that defines the port 2.4 REST Implementation
which is later mapped to the overarching While SOAP adheres very closely to the
Portal SOAP service set. The port itself is RPC model, REST revolves around the
composed of multiple operations, each one concept of resources and focuses on using
representing a single service to be the inherent power of HTTP to retrieve
implemented in the set. In turn, each representations of these resources in varying
operation maps previously-defined SOAP states. In REST style, every resource is
messages as its input and output types [1]. signified by a unique URL which may be
All the methods and functions in SOAP operated on by a subset of the core set of
server must be registered with WSDL and a HTTP commands: Get, Post, Put, and Delete
SOAP client created to access the defined [10].
methods. The content of this WSDL file Compared to SOAP, instead of a specialized
represents a language- and platform-neutral SOAP client, any HTTP client library may
method of remotely communicating the be used to interact with the Portal REST
SOAP service interface. Once the WSDL server. Every contemporary language comes
file for the SOAP implementation of the equipped with a built-in HTTP library as it
service-oriented architecture is written, it is a universal protocol for communicating
needs to be made publicly available to all over the Internet [4].
portal clients capable of reaching a
particular Portal server. This is done through 3. Evaluation
the use of a SOAP-enabled HTTP web
Comparatively, from the experiments that
server; and may be enabled in a variety of
were don in this research; REST has proved
different ways.
to be better and easy to maintain as it is an
architecture that needs very few lines of
code to do any urgent changes required
during maintenance or modifications to

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 108


solve a specific problem compared to SOAP two prototypes are used to access the same
which requires modification of the WSDL, data for political and members data from the
client and server files. In terms of registrar of political parties database and the
performance, REST takes shorter time to results are accessed and viewed from a web
load similar amount of data as compared to application.
SOAP and also it uses less resources e.g. The evaluation for both services is carried
Memory and processing power. out using two different scenarios. In the first
In terms of complexity REST API accesses set of experiments the level of internal
data directly from the database tables while resource consumption is examined including
SOAP requires a soap server, WSDL and a memory resources. In the second set of
soap client to access the same data from the experiments the overall performance is
database table. evaluated by measuring total elapsed
Use of REST frame work will help the response time for execution of each request.
registrar of political parties manage partys After that, evaluation for the two web
membership with computing resources that service is done to determine the best
have better performance, maintainability and performer [9].
extensibility incase of future needs. ii). Scalability measure
The two prototypes REST and SOAP are
experimented on how well they grow or
a) Experimental procedures
expand with the increased users; this was
As previously mentioned, the main objective
done by using apache-jmeter which tests
of this project is to investigate how REST
throughput with the increase in the number
and SOAP compares and to examine the
of users accessing the same data.
performance, scalability, maintainability and
For the two prototypes you create a test plan
extensibility of the Web Services in
for threads (users), the set the thread
application development.
properties, finally you add and set the
The experimental procedure followed
requests by specifying the server name (IP
evaluates the best web service to be used.
of the server), the path of the HTTP request,
Following is description of the experiments
where the listeners will get their results
taken:-
from.
i) Performance measure
Two prototypes are used to carry out the The process / experiments are repeated as
experiments needed to check on the many times as possible depending on the
performance of the Web Services during number of users (samples) you intend to run.
data access from the database server. The

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 109


The data used in the experiment is simulated data from the server and the memory
data that is got by consolidating it from required in finishing the process.
different sources i.e. CSV, TXT and XLS Scalability of the prototype architecture is
into the MYSQL database. The web service determined by how it grows to
technologies will now fetch the data and accommodate increasing number of users,
present it through a common browser. applications and system.
Maintainability and Extensibility of the
b) Parameters to be measured prototype is measured by how it can accept
The main parameters that are measured in significant extension of its capabilities,
this research are performance, scalability, functionality, enhancement for the purpose
maintainability and extensibility. of meeting future needs and significantly
changing requirements without major
Performance of the prototypes is determined rewriting of code or changes in its basic
by the amount of the time they take to pull architecture.
Experimental Results and SOAP web services which are depicted
a. Performance in Figures 1 and 2.
Table 1: below shows the performance
results for time and memory used by REST
Transaction Data REST REST SOAP SOAP
ID Records Memory Time Memory Time
1 10 2.4 0.06 3.504 0.1842
2
40 3.0 0.8 4.38 2.456
3 70 4.0 0.1 5.84 0.307
4 110 4.4 0.26 6.424 0.7982
5 140 5.2 0.3 7.592 0.921
TABLE 1: REST AND SOAP DATA ON PERFORMANCE

Memory Usage Graph

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 110


FIGURE 3: MEMORY REQUIRED FOR DATA ACCESS IN REST AND SOAP

Figure 3: show RESTful web services need table compared SAOP which needs over one
by far less amount of memory to fetch the and half times of memory to fetch the same
same amount of data from the same database amount of data in bytes.

Time Usage Graph

FIGURE 4: TIME REQUIRED FOR DATA ACCESS IN REST AND SOAP

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 111


Figure 4: shows the response time in Scalability
seconds for accessing the same amount of Table 2: below shows the scalability results
data for the two web services. The response measuring throughput based on the number
time of RESTful web service is smaller than of users accessing the same data using
for SOAP web service which is three times REST and SOAP web services.
more.

USER SAMPLES

Sample (Users) 10 20 30 40 50 60 70 80 90 100

REST Throughput 5.1 36.7 29 27 27 24 24 23 23.2 46

SOAP throughput 10 32.5 14 17 19 21 23 24.9 26.2 27


TABLE 2: REST AND SOAP DATA THROUGHPUT BASED ON USERS

Scalability of SOAP and REST

FIGURE 5: SCALABILITY OF REST AND SOAP MEASURED USING THROUGHPUT

Figure 5: shows the throughput in bytes per both REST and SOAP scale almost evenly
second as the number of users connecting to but with RESTful web service having a
the server increase. The graph indicates that

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 112


slightly higher throughput with the increase while REST is architecture web service
in number of users compared to SOAP. though they all use common standards.
From the experiments done in this research,
4.0 Results Discussion REST has proved to be better in terms of
These results support that RESTful web performance and scalability as well as being
service is recommended for web application easy to maintain as it is an architecture that
development. Therefore, REST offers a needs very few lines of code to do any
perfectly good solution for the majority of urgent changes required during maintenance
implementations with greater advantages or modifications to solve a specific problem.
and lower overheads as has the best In terms of performance, the response time
performance and scalability. of RESTful web service is smaller than for
SOAP web service which is three times
4.1 Implication more. In addition RESTful web services
Use of REST frame work will help the need by far less amount of memory to fetch
registrar of political parties manage partys the same amount of data from the same
membership with computing resources that database table compared SAOP which needs
have better performance, scalability and over one and half times of memory to fetch
maintainability. the same amount of data in bytes.

4.2 Impact to the potential users REST has also demonstrated high degree of

The usage of web service technologies will scalability with increasing number of users

be of great assistance in providing sanity accessing the system at the same time;

and a solution to the registrar of political REST has a slightly higher throughput with

parties problems of registering genuine and the increase in number of users compared to

legitimate members to various political SOAP web services.

parties. REST has proved to be very In terms of complexity REST API accesses

efficient in data consolidation from different data directly from the database tables while

sources into a common database and data SOAP requires a soap server, WSDL and a

access with improved performance and soap client to access the same data from the

scalability. database table.

4.3 Conclusion 4.4 Future Research

REST and SOAP differ in context and Future research may address security and

usage; SOAP is a protocol web service the analytical bit of the captured data,

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 113


comparing REST and SOAP; including Web Services grows every day, but REST
automatic alerts in case the system and SOAP are probably the most popular.
encounters are member who is registered SOAP being the first technology it was
more than once across different political rapidly becoming the standard protocol for
parties. accessing Web Services using XML
The research should also measure the same messages to exchange information across
benchmarks on machines of different specs endpoints, and provides several advantages
and model comparing REST and SOAP. over other binary protocols.
With advancement of the technology, Web
5.0 Related Work Services are the key point of Integration for

Recent researches have comparatively used different applications belonging to different

SOAP and REST web service technology Platforms, Languages, and systems. To

measuring different aspects on quality of achieve this, Representational State Transfer

service. Measuring quality attributes of web (REST) which basically means that each

services is inherently difficult due to the unique URL is a representation of some

very virtues of service-oriented object was brought into action so as to outdo

architectures. Different aspects of SOAP.

performance measurement and REST APIs havent been around for long

benchmarking of web services have been and their APIs are definitely modern for

analyzed. However, most approaches do not creating most of the web services [6].

provide concrete ways of measuring


performance of services in a specific 5.1 Yahoo Web Services based on
architecture. Detailed performance REST approach
measurement of web services is particularly Yahoo provides a variety of Web services at
important for obtaining quality attributes http://developer.yahoo.net/, from searching
that can be used for service selection and the web to interfacing with Flickr (Yahoos
composition, and for discovering photo-sharing community). Using REST,
bottlenecks to enable optimization of you can easily add integration for them
composite service processes [8]. within a Web page or larger application.
Although several services are available, this
Web Services is a modern and popular case study demonstrates how to perform a
technology in managing institutional data Web search
and systems. To manage the Web service a (http://developer.yahoo.net/search/web/) and
list of protocols and technologies related to how to perform a product search

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 114


(http://developer.yahoo.net/shopping/V1/pro Mr. C. Ronge for their time, input and also
ductSearch.html). Using the ideas and for their contribution in critiquing the paper.
techniques presented in the examples, it is
quite easy to apply them to access other References
offered services. [1] Chappell, D. (2009). SOAP vs.
REST:Complements or Competitors?
San Francisco, California: Chappell &
The Flickr service requires its own API key. Associates.
Although a lot of functionality does not [2] Elkstein, M. (n.d.). Learn REST: A
Tutorial. Retrieved February 1, 2013,
require authentication, to upload photos you from Learn REST: A Tutorial:
must also register for an API secret key (at http://rest.elkstein.org/
[3] Gavin Mulligan, D. G. (2009). A
http://www.flickr.com/services/api/registere Comparison of SOAP and REST
d_keys.gne) once you have your API key. implementations of a service based
interaction independence middleware
framework. Proceedings of the 2009
5.2 Use of SOAP in the Mobile Winter Simulation Conference , 3-6.
[4] Jon, F. (2007, July). Which is better,
Technology REST or SOAP? Retrieved July 11,
SOAP has been used in Unstructured 2013, from SOAP, REST, and More:
http://msdn.microsoft.com/en-
Supplementary Services Data (USSD) us/magazine/dd942839.aspx
service, which allows high speed interactive [5] Kishor Wagh, R. T. (2012). A
Comparative Study of SOAP Vs REST
communication between mobile subscribers Web Services Provisioning.
and applications across Interfaces to SOAP, Journal of Information Engineering
and Applications , 2-4.
XML, LDAP services [6] Singh, T. (2009, August 24). REST vs.
SOAP The Right WebService.
Retrieved January 28, 2013, from
Basically the way USSD works is that you REST vs. SOAP The Right
send some cryptic number like *333# to WebService: http://geeknizer.com/rest-
vs-soap-using-http-choosing-the-right-
your mobile servers who in turn forward the webservice-protocol/#ixzz2IcJgJ2yO
request via various protocols mostly HTTP [7] wuher. (2010, November 12). Rest vs.
Soap. Has REST a better performance?
or SOAP but not limited to these. Retrieved July 11, 2013, from web
services - Rest vs. Soap. Has REST a
better performance? - Stack Overflow:
http://stackoverflow.com/questions/416
3066/rest-vs-soap-has-rest-a-better-
performance
5.3 Acknowledgment [8] Christoph Becker, H. K. (2009). An
My sincere gratitude goes to Mr. Lawrence Extensible Monitoring Framework
forMeasuring and Evaluating Tool
Muchemi, Dr. E. Opiyo, Mr. A. Mwaura, Performance in a Service-oriented
Architecture. 1-3.

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 115


[9] Feda AlShahwan, K. M. (2010).
Evaluation of Distributed SOAP and
RESTful Mobile Web Services.
International Journal on Advances in
Networks and Services, vol 3 no 3 & 4,
year 2010, , 8-10.
[10] Maven. (2011). Lightweight REST
framework. Retrieved June 4, 2013,
from Lightweight REST framework:
http://essentialsource.sourceforge.net/d
ocumentation/rest.html

Book Chapter: Trends in Distributed Computing Applications-978-9966-074-13-3Page 116

You might also like