Professional Documents
Culture Documents
Tech Seminar Report
Tech Seminar Report
Bachelor of Engineering
In
Computer Science and Engineering
SUBMITTED BY:
Puneet Yadav
1JS18CS117
CERTIFICATE
This is to certify that Mr. Puneet Yadav bearing the USN 1JS18CS117, VIII
semester Bachelor of Engineering in Computer Science and Engineering has
presented and successfully completed the Technical Seminar titled “RESTful
Web Services” for the partial fulfilment for the award of Bachelor of
Engineering degree under Visvesvaraya Technological University Belagavi,
during the academic year 2021-2022.
Puneet Yadav
1JS18CS117
ACKNOWLEDGEMENTS
The successful completion of any task would be incomplete without the mention of people
whose constant guidance and encouragement crowned my effort with success.
I express my gratitude to, Dr. Bhimasen Soragaon, Principal, JSS Academy of Technical
Education, for providing me excellent facilities and academic ambience which have helped
me in satisfactory completion of this Bachelor Degree.
I express my truthful thanks to Dr. Naveen N.C, Professor & HOD, Dept. of CSE, JSS
Academy of Technical Education, for his valuable support and encouragement.
I would also like to thank the Seminar Coordinators for helping us present this seminar
successfully.
Finally, I take this opportunity to extend my earnest gratitude and respect to my parents,
teaching & non-teaching staffs of the department, the library staff and all my friends, who
have directly or indirectly supported me.
Regards,
PUNEET YADAV
[1JS18CS117]
JSSATE, Bengaluru-560060
ABSTRACT
By its nature, user actions within a distributed hypermedia system require the transfer of
large amounts of data from where the data is stored to where it is used. Thus, the Web
architecture must be designed for large-grain data transfer. The architecture needs to
minimize the latency as much as possible. It must be scalable, secure and capable of
encapsulate legacy and new elements well, as Web is subjected to constant change. REST
provides a set of architectural constraints that, when applied as a whole, address all above
said issues.
TABLE OF CONTENT
1 Introduction 2-3
Conclusion 14
References 15-16
On-Air Hand-Drawn Doodles for IoT Devices Authentication During COVID-19
CHAPTER 1
INTROUCTION
A Web service is a Web page that is meant to be consumed by an autonomous program.
Web Service requires an architectural style to make sense of them as there need not be a
human being on the receiver end to make sense of them. REST (Representational State
Transfer) represents the model of how the modern Web should Work. It is an
architectural pattern that distills the way the Web already works.
REST provides a set of architectural constraints that, when applied as a whole,
emphasizes Scalability of component interactions, generality of interfaces, independent
deployment of Components, and intermediary components to reduce interaction latency,
enforce security, and Encapsulate legacy systems.
A web service is nothing but a web page and it is consumed by an autonomous program.
The restful web services are a base of two vital factors and they are HTTP and REST. The
abbreviation of Representational State Transfer is known as REST and this explains about
architectural principles. With the avail of these principles, one can create a web service
that focuses on the resource of the system and this also includes the addresses of resource
states and transferring of resource states over HTTP by a large number of clients written
in various languages. From the last two years, the REST is the one and only predominant
model of web service, it is so simple to use that it has replaced many interface designs
based on SOAP and WSDL.
What is REST?
REST defines a set of architectural principles by which you can design Web services that
focus on a system's resources, including how resource states are addressed and transferred
over HTTP by a wide range of clients written in different languages. If measured by the
number of Web services that use it, REST has emerged in the last few years alone as a
predominant Web service design model. In fact, REST has had such a large impact on the
Web that it has mostly displaced SOAP- and WSDL-based interface design because it's a
considerably simpler style to use.
RESTful web services are built to work best on the Web. Representational State Transfer
(REST) is an architectural style that specifies constraints, such as the uniform interface,
that if applied to a web service induce desirable properties, such as performance,
scalability, and modifiability, that enable services to work best on the Web. In the REST
architectural style, data and functionality are considered resources and are accessed
using Uniform Resource Identifiers (URIs), typically links on the Web. The resources
are acted upon by using a set of simple, well-defined operations. The REST architectural
style constrains an architecture to a client/server architecture and is designed to use a
stateless communication protocol, typically HTTP. In the REST architecture style, clients
and servers exchange representations of resources by using a standardized interface and
protocol.
CHAPTER 2
Stateless: each request from client to server must contain all the information necessary
to understand the request, and cannot take advantage of any stored context on the server.
Uniform interface: all resources are accessed with a generic interface (e.g., HTTP
GET, POST, PUT, DELETE).
Named resources - the system is comprised of resources which are named using a
URL.
2. Create a URL to each resource. The resources should be nouns, not verbs. For example,
do not use this:
http://www.parts-depot.com/parts/getPart?id=00345
3. Categorize your resources according to whether clients can just receive a representation
of the resource, or whether clients can modify (add to) the resource. For the former, make
those resources accessible using an HTTP GET. For the later, make those resources
accessible using HTTP POST, PUT, and/or DELETE.
4. All resources accessible via HTTP GET should be side-effect free. That is, the resource
should just return a representation of the resource. Invoking the resource should not result
in modifying the resource.
6. Design to reveal data gradually. Don't reveal everything in a single response document.
Provide hyperlinks to obtain more details.
7. Specify the format of response data using a schema (DTD, W3C Schema, RelaxNG, or
Schematron). For those services that require a POST or PUT to it, also provide a schema
to specify the format of the response.
8. Describe how your services are to be invoked using either a WSDL document, or
simply an HTML document.
It is important to create REST API according to industry standards which results in ease
of development and increase client adoption.
Architectural Constraints of RESTful API: There are six architectural constraints
which makes any web service are listed below:
• Uniform Interface
• Stateless
• Cacheable
• Client-Server
• Layered System
• Code on Demand
Stateless: It means that the necessary state to handle the request is contained within the
request itself and server would not store anything related to the session. In REST, the
client must include all information for the server to fulfill the request whether as a part
of query params, headers or URI. Statelessness enables greater availability since the
server does not have to maintain, update or communicate that session state. There is a
drawback when the client need to send too much data to the server so it reduces the
scope of network optimization and requires more bandwidth.
Cacheable: Every response should include whether the response is cacheable or not and
for how much duration responses can be cached at the client side. Client will return the
data from its cache for any subsequent request and there would be no need to send the
request again to the server. A well-managed caching partially or completely eliminates
some client–server interactions, further improving availability and performance. But
sometime there are chances that user may receive stale data.
Code on demand: It is an optional feature. According to this, servers can also provide
executable code to the client. The examples of code on demand may include the
compiled components such as Java applets and client-side scripts such as JavaScript.
Rules of REST API: There are certain rules which should be kept in mind while
creating REST API endpoints.
• HTTP verbs are used to identify the action. Some of the HTTP verbs are –
GET, PUT, POST, DELETE, UPDATE, PATCH.
• A web application should be organized into resources like users and then
uses HTTP verbs like – GET, PUT, POST, DELETE to modify those
resources. And as a developer it should be clear that what needs to be done
just by looking at the endpoint and HTTP method used.
HTTP verbs: Some of the common HTTP methods/verbs are described below:
• GET: Retrieves one or more resources identified by the request URI and it
can cache the information receive.
2.4 Advantages
1. Easy to integrate
A decent RESTful API may be found from the very first URI. This isn’t to say that each
application that uses your service will know what to do automatically. It does, however,
make things easier for the developer who is attempting to connect your API.
2. Use of HTTP
The usage of ubiquitous standards is another characteristic for ease of integration that has
to do with REST over HTTP (THE most popular implementation of REST). Speaking of
HTTP, the web’s protocol, and outputting JSON or ATOMPub means finding a library
that can connect to you in any language and the platform is much easier.
3. Scalability
4. Independence
Because of the separation between client and server, the REST protocol allows for
autonomous development across several sections of a project. Furthermore, the REST
API is adaptable to operational syntax and platform. This allows testing in a variety of
contexts throughout development.
5. Uniform Interface
When creating a REST API, developers agree to follow the same standards. Hence, the
output is a consistent interface across all APIs. This interface functions as a contract
between the client and the service, and it is shared by all REST APIs. How is this
useful? When developers utilize APIs, they require global ideas to ensure that they can
communicate with one another.
6. Layered System
Every REST-enabled component has no access to components other than the one with
whom it is communicating. This means, that a client who connects to an intermediary
component does not know with whom that component will engage later. This encourages
developers to design separate components that are easy to upgrade.
REST overcomes many of the disadvantages of SOAP, such as the need for clients to know
the operation semantics as a pre-requisite for its use, or the use of different ports for
different types of notifications. In addition, REST can handle many resources,
while SOAP needs many operations to accomplish that.
2.5 Disadvantages
• Lack of state: most web applications require stateful mechanisms. Suppose you
purchase a website which has a mechanism to have a shopping cart. It is required
to know the number of items in the shopping cart before the actual purchase is made.
This burden of maintaining the state lies on the client, which makes the client
application heavy and difficult to maintain.
• Last of security: REST doesn’t impose security such as SOAP. That is the reason
REST is appropriate for public URLs, but it is not good for confidential data passage
between client and server.
The stateless constraint reflects a design trade-off. The disadvantage is that it may decrease
network performance by increasing the repetitive data (per-interaction overhead) sent in a
series of requests, since that data cannot be left on the server in a shared context. In addition,
placing the application state on the client-side reduces the server’s control over consistent
application behaviour, since the application becomes dependent on the correct
implementation of semantics across multiple client versions.
1. Do not use "physical" URLs. A physical URL points at something physical -- e.g., an
XML file: "http://www.acme.com/inventory/product003.xml". A logical URL does not
imply a physical file: "http://www.acme.com/inventory/product/003".
• Sure, even with the .xml extension, the content could be dynamically generated.
But it should be "humanly visible" that the URL is logical and not physical.
2. Queries should not return an overload of data. If needed, provide a paging mechanism.
For example, a "product list" GET request should return the first n products (e.g., the first
10), with next/prev links.
3. Even though the REST response can be anything, make sure it's well documented, and
do not change the output format lightly (since it will break existing clients).
• Remember, even if the output is human-readable, your clients aren't human users.
• If the output is in XML, make sure you document it with a schema or a DTD.
4. Rather than letting clients construct URLs for additional actions, include the actual
URLs with REST responses. For example, a "product list" request could return an ID per
product, and the specification says that you should use
http://www.acme.com/product/PRODUCT_ID to get additional details. That's bad design.
Rather, the response should include the actual URL with each item:
http://www.acme.com/product/001263, etc.
• Yes, this means that the output is larger. But it also means that you can easily
direct clients to new URLs as needed, without requiring a change in client code.
5. GET access requests should never cause a state change. Anything that changes the
server state should be a POST request (or other HTTP verbs, such as DELETE).
CONCLUSION
Service-Oriented Architecture can be implemented in different ways. General focus is on
whatever architecture gets the job done. SOAP and REST have their strengths and
weaknesses and will be highly suitable to some applications and positively terrible for
others. The decision of which to use depends entirely on the circumstances of the
application.
So, to conclude, REST is a type of data transfer that is built upon the architecture of the
HTTP protocol. It allows you to easily send and retrieve data between two different services
using XML or JSON.
When structuring your web applications, it’s usually good practice to build them using
RESTful architecture. This means that collections and resources are easily recognised and
can form the basis of building a RESTful API.
When you build an application that requires a JavaScript heavy front-end, or integration
with a smartphone application, using a RESTful architecture becomes a necessity because
it allows you to transfer data from the API to the client. It’s often good practice to plan
out your RESTful collections and resources at the very outset.
So, the next time you start a web application project, think about how you can make it
more RESTful. It will probably not only make your application’s architecture better, but
it will also allow you to easily build an API in the future to integrate with other services
or applications.
REFERENCES
[1] D. Denoncourt, "How to Put Ajax JSON REST and RPG to Work Creating an RPG
Browser", System iNEWS, no. 369, pp. 9-15, July 2010.
https://scholar.google.com/scholar?as_q=How+to+Put+Ajax%2C+JSON%2C+REST%2
C+and+RPG+to+Work+Creating+an+RPG+Browser&as_occt=title&hl=en&as_sdt=0%2
C31
[2] Y.-H. Chen, P.-C. Su, and F.-T. Chien, ‘‘Air-writing for smart glasses by effective
fingertip detection,’’ in Proc. IEEE 8th Global Conf. Consum. Electron. (GCCE), Oct.
2019, pp. 381–382, doi: http://dx.doi.org/10.1109/GCCE46687.2019.9015389
[4] C. M. Garcia and R. Abilio, Systems Integration Using Web Services REST and SOAP:
A Practical Report, 2017.
https://scholar.google.com/scholar?as_q=Systems+Integration+Using+Web+Services%2
C+REST+and+SOAP%3A+A+Practical+Report&as_occt=title&hl=en&as_sdt=0%2C31
[5] E. John and M. Siddique, "Efficient Semantic Web Services Development Approaches
using REST and JSON," 2021 International Conference on Decision Aid Sciences and
Application (DASA), 2021, pp. 231-235,
doi: https://doi.org/10.1109/DASA53625.2021.9682324
[6] A. Solichin, M. Andika Putra and K. Diniari, "RESTful Web Service Optimization with
Compression and Encryption Algorithm," 2018 International Seminar on Application for