Review of Web Service Technologies: REST over SOAP

Recently, most of the web applications depend on the web services to solve the application integration problem. Web service is an intermediate software that allows the interaction between the applications written by different languages. Web Service is a client-server, modular, self-contained, and dynamic application that ensures the communication between the applications via the World Wide Web (WWW). The aim of this paper is to choice right kind of Web services at design stage of the project. Thus, we provide an overview of web services. Next, we clarify the architecture of web services. After that, we focus on the most popular kinds of web services, the Representational State Transfer (REST) and the Simple Object Access Protocol(SOAP) then explain APIs details. Finally, we address the performance evaluation of the previous works and explained the results as comparison between SOAP and REST. A recommendation to use RESTful web services has been concluded from experimental result.


Introduction
Nowadays is the ear of the internet, the user communicates to applications, furthermore, there is application to application interaction [1,2].Web Service is the most common way for applications to applications communicate across an internet protocol backbone [1,3].The World Wide Web Consortium(W3C) provided a more price definition to Web Services as: "a software application identified by a URI, whose interfaces and bindings are capable of being defined, described, and discovered as XML artifacts.A Web service supports direct interactions with other software agents using XML-based messages exchanged via Internetbased protocols" [4].
Unlike Web application, Web services do not provide the user GUI, rather than it designed to exchange data among different languages and platform-based applications through a programmatic interface over the network called a WEB API [5].
SOAP and REST are Web services' types.SOAP stands for Simple Object Access Protocol.SOAP, XML-messaging protocol that transfers the data over HTTP protocol.SOAP have restrictions over the representation format, is accepted only XML format [6].
Representational State Transfer(REST) is an architectural style for web services.In REST, the server responds to client requests by using any resources allowed in computer systems [7].The representation format can be in JSON or XML.Both Web Services types enable heterogeneous environments and languages based applications to communicate with each other [8,9].The purpose from this paper is to choice which of Web services technologies that should be use at design stage of the project.To achieve this purpose, we explain APIs details, address the performance evaluation of the previous works and clarified the results as comparison between SOAP and REST.M. Massé (2013) presented the set of rules to design the REST API then addressed the needs of clients and why choose the REST API [11].P. Giessler & et.al (2015)  Grabis (2016) compared between the REST and SOAP APIs by using the software evaluation metrics and found out the REST is lower than SOAP in response time.Further, the SOAP is less than REST in the number of line code [14].F. Halili & E. Ramadani (2018) clarified the advantages and disadvantages of RESTfull web services and SOAP-based web services, in addition to a comparison study between them [15].A. Soni et al (2019) presented the comparative analysis between REST API and SOAP API based on response time, execution speed, and memory usage features [16].

Web Service Architecture
Service provider, service requester, and service registry are composed the Web Service architecture.Figure (1) exhibits the visual view of Web Services architecture.Service provider creates the Web services and provides the implementations and interface of it after that publishing the service descriptions in the service registry.Service Registry catalogs the information of Service descriptions that contain the details of service API, implementation and the location (where the service is found), and looking for the desired service when the Service Requester sends a query.Then, the Service Requester can interact with Service Provider [17].2. Loose coupling -the web service client and the server are not tied closely.So, there is no direct link between them.By adopting an architecture -based loosely coupled tends to facilitate the management of the software systems and the integration among them.
3. Adaptability -the web services can work by using a synchronous or asynchronous method.the synchronous means the service consumer cannot execute any operation until receiving the response from the server.while asynchronous allows the parallel execution without waiting for the response.
4. Reusability -the web services are available on the internet, therefore, it provides the meaning of code reusable.

Interoperability -web services can be sharing the data between varied applications (i.e
written by different languages).

Service
Providers by sending the query to the service registry.

SOAP API
Simple Object Access Protocol, the standard messaging protocol that enables computing systems that are built on different kinds of programming languages to communicate with each other by used XML messages over HTTP protocol.SOAP Protocol follows distributed systems in some features such as security, privacy, the quality of attachment, and reliability [15].SOAP is an independent platform, hence, it can work with any programming language and operating system.
The main concept of SOAP is the Provider publishes the service in the registry then the requester binds it according to registry query answer [18].The request and the respond calls appear as SOAP messages, Figure .2represents the structure of the SOAP message and figure.3display a sample of SOAP message.the Web Service Description Language(WSDL) defines the XML message structure [19].The structure of SOAP message consists of the following elements [20]: -The Envelope element: it's the root element that identify and encapsulate the XML document's details in the SOAP message.
-The header element: this element contains optional information related to specifics or requirements of documents such as the authentication.
-The body element: it's a necessary element, that contains request and response information that directed between web service and application.
-The Fault element (Optional): it shows error information that occurs during request and response message, as well, status information.-Client-Server: this constrain aims to improve the flexibility of the user interface by separate the data storage from the user interface.Also, simplify the server components will improve the scalability.Hence, separation of concerns is an essential aspect behind the Client-Server constraint.
-Stateless: the principle of this constrain depend on no recourses management, in other words, the server will not have information about the previous request, it replies according to the information found in the current request.The stateless communication between the client and the server enhanced reliability, visibility, and scalability.
Cache: as we mentioned in stateless constrain which make the nature of the request is independent and to save networking traffic between the client and server, the cache resides on the client to store the responds data then reuse them for equivalent requests if the response is cacheable.Cache constrain enhancing scalability, efficiency and reduces the average latency of some interactions.
-Uniform Interface: REST-style has four constraints to design a Uniform Interface that improved and simplified the interactions between the components.the REST uniform interface represented by identifying the resources, manipulation of the resources by the representation, self-description based messages, and hypermedia.
-Layered System: The layered system style prompts hierarchical layers based constraining component in an architecture, so each component cannot "see" the immediate layer interaction.
-Code on demand: REST Style allows to extend the client functionality by downloading and executing code, that code can be in the form of scripts or applets.This simplified preimplemented at clients by reducing the required features.

REST Data Elements
1-Resources: any information that can be the destination of hypertext references.The information may be an image, a document, person, collection of resources, and so on [22,23].

2-Resources Identifier: It identifies each resource that communicates between
components by a Uniform Resource Identifier (URI) [22,23].
3-Resources Representation: REST represents the current actions state of recourses by data and metadata to describe these data, then transfers it between components [22,23].

Resource Methods
REST API develops over HTTP, hence, it follows HTTP methods to define the action for request and response to communication between the components.To perform the operations on the service, the following HTTP methods are used [22,24]: 1-GET: Retrieve resource by request its URI.

The Performance Evaluation
Many authors worked on the different metric to display the performance of SOAP and RESTful web services, here, we will display some of these works then extract the comparison on performance of SOAP and RESTfull web services based on different metrics: In [25], The evaluation of a RESTful and SOAP web service on mobile devices implemented.Two benchmarks with the float and the string data types are used as parameters to measure a message size and a session time of service call.Table1.Shows the high performance RESTful over SOAP in a message size and a session time.In table1, we noticed the average of message size of string concatenation are 395 and 63.8 for SOAP and REST respectively.Also, the average of message size of float number addition are 395 and 63.8 for SOAP and REST respectively.In addition, the time average of string concatenation was 856.2 and 371.8 for SOAP and REST respectively.Finaly, the time avarege of float number addition of SOAP and REST were 890.6 and 371.8, respectively.Hence, RESTful offers a good solution for the common of implementations, with lower overhead and higher flexibility.
On another hand, REST Web Services and SOAP Web services are tested for mobile computing by using Energy Consumption and Execution Time parameters in the matrix multiplication app (the developed prototype).Figure .4shows the comparison between them.
Conducting results display RESTfull is better than SOAP about 200% in the execution time and 250% in the energy consumption [26].the WS-Security is one of the standards of SOAP protocol to encrypting messages so that the data transfer becomes safer, while, the REST approach is based on built in security HTTP (or HTTPS).the point-to-point communication protected by Transport layer security(TLS) but the problematic is happened if the mobile devices involved, TLS channel should be reset frequently [27].Thus, SOAP based services is more Reliability than RESTfull services.
In [9] JAX-WS and JAX-RS are used to design SOAP API and REST API, respectively and tested by using a Postman (API testing tool) in terms of memory usage and response time.This gives insight view of which service is better to use as per requirements.The result of experiments demonstrations that the response time of REST is take about 4ms to 7ms less than SOAP.It has been observed that as number of API increases, REST takes approximate 1MB to 2MB less memory usage than SOAP.
From the viewpoint of maintains, complexity, lines of code and cost, the development and implementation RESTfull is easier than the SOAP based services because the REST protocol is closely to the HTTP protocol and it uses basic operations of the HTTP for instance GET, POST, PUT, etc.In addition, it uses the standards of W3C / IETF (HTTP, XML, URI, and MIME) [14,28].

Comparison Summary
By taking into consideration of the previously viewed.

Conclusion
As a result of the comparison between REST and SOAP services, we concluded that the RESTfull web services use all the features of HTTP, therefore, it is simple in the development and the maintains and.Furthermore, RESTfull web services easy to consume, fast, lightweight, self-descriptive, support all types of data, and need less (bandwidth, response time, and memory requirements).So, we can say, RESTfull web services will continue in the coming years to lead the more of the technology space.

2 .
Related Work K. Wagh & R. Thool (2012) listed out the comparison between the REST and SOAP frameworks and found the REST is more suitable for the wireless communication than SOAP.In another hand, the SOAP is more secure than REST for the same purpose [10].S. Mumbaikar & P. Padiya (2013) demonstrated the REST and SOAP-based web services comparison for the mobile environment depend on the different metrics and concluded that the RESTfull web services is better than the SOAP-based web services in the performance, where The RESTful web services are Self-descriptive, lightweight, easy with high flexibility and lower overhead [1].

Figure 1 -
Figure 1-An architecture of Web services

3. 3
REST APIRepresentational State Transfer (REST) is an architecture style that has a set of constraints and rules to determine Application Programming Interface(API) which allows each application to talk with others.REST follows HTTP methods to perform the communication operations (request and response) then return the response in JSON/XML format to the client[21].RoyFielding (2000)  defined REST constraints in his dissertation in 2000.These constraints are listed below:

Figure 4 .
Figure 4. Performance Comparison of Web Services mobile services[26] categorize the best 23 practices for developing RESTfull services into 8 classes and explain the practice of web services on diverse applications [12].D. Qiu & et al. (2016), described the development of API in Java programming language and analyzed about 5000 Java projects(open-source projects).They reached from this research that the deprecated APIs are broadly used more than the core APIs [13].J. Tihomirovs & J.

Table 2 .
Demonstrates the concluded results of the RESTfull and SOAP Web Services performance.

Table 2 .
Comparison of Web Services Performance (REST & SOAP)