SlideShare a Scribd company logo
REST based Web Services
• Overall Web Services architecture consists of many layers including
protocols and standards for security and reliability.
• Therefore it becomes complicated and time/resource consuming for
developers of simple web services.
• Web Services can be implemented in Web environments too, on top of
basic Web technologies such as HTTP, Simple Mail Transfer Protocol
(SMTP), and so on.
REpresentational State Transfer (REST) has gained widespread
acceptance across the Web as a simpler alternative to SOAP and WSDL
based Web services.
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.
Simply put, it is the architecture of the Web.
REST has emerged in the last several years alone as a predominant Web service design
model.
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.
REST is preferable in problem domains that are query intense or that require exchange of
large grain chunks of data.
Basically, you would want to use RESTful web services for integration over the web.
SOAP and WSDL based Web services (“Big” Web services) are preferable in
areas that require asynchrony and various qualities of services.
Finally, SOAP-based custom interfaces enable straightforward creation of
new services based on choreography.
Therefore, you will use big web services in enterprise application integration
scenarios that have advanced quality of service (QoS) requirements.
What is REST?
“Representational State Transfer is intended to evoke an image of how a
well-designed web application behaves: a network of web pages (a virtual
state-machine), where the user progresses through an application by
selecting links (state transitions), resulting in the next page ( representing the
next state of the application) being transferred to the user and rendered for
their use.
REST- An Architectural Style of Networked System
Underlying Architectural model of the World Wide Web.
Guiding framework for Web protocol standards.
RESR based web services
Online shopping
Search services
Dictionary services.
Characteristics of a REST based network
Client-Server: a pull-based interaction style (Client request data from servers as
and when needed).
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.
Cache: to improve network efficiency, responses must be capable of being
labelled as caheable or non-cacheable.
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.
Interconnected resource representation: the representations of the resources are
interconnected using URLs, thereby enabling a client to progress from one state to another.
The characteristics of the restful web services are as below:
The restful web services have a pull-based client-server interaction manner.
Every request from the client to the server must possess the required data to understand the
request and it cannot take the profit of any saved content on the server.
To advance or develop the network efficiency outputs it must be capable of being labelled
as cacheable or non-cacheable.
Principles of REST web service design
• Identify all the conceptual entities that we wish to expose as services.
(Examples we saw include resources such as : parts list, detailed part data,
purchase order)
• Create a URL to each resource.
• Categorize our resources according to whether clients can just receive a
representation of the resource (using an HTTP GET), or whether clients can
modify (add to) the resource using HTTP POST, PUT and/or DELETE).
• 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.
• Put hyperlinks within resource representations to enable clients to drill down for more
information, and/or to obtain related information.
• Design to reveal data gradually. Don’t reveal everything in a single response document.
Provide hyperlinks to obtain more details.
• 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.
• Describe how our services are to be invoked using either a WDL document or simply an
HTML document.
Principles of Restful Web Services:
The principles of the restful web services are as follows:
• REST network is a key for designing the web services.
• It requires or needs to create a URL for every device.
• The resources have to be arranged in a format that helps the client.
• The resources accessible through HTTP should be free of side effect.
• The hyperlinks should be kept within the representation of resources.
• The design should be in a manner that reveals the information gradually.
Advantages of Restful Web Services:
The advantages of restful web services are as follows:
• The restful web services have the scalable equipment interactions.
• It possesses the general interfaces.
• It can independently deploy the connections.
• It decreases the interaction latency.
• It strengthens or improves the security.
• It has the feature of safe encapsulation of legacy systems.
• It sustains the proxies and gateways as information transformation and caching
equipment.
• Restful web services scale to a huge number of clients.
• It enables the alienate of information in streams that possess infinite size.
Disadvantages of Restful Web Services:
The disadvantages of restful web services are as follows:
• It destroys few advantages of other architectures.
• Restful web services have a state of interaction with an FTP site.
• It contains a single interface for everything.
• It reduces the performances of the new by enhancing the repetitive
information.
Why are Restful Web Services so popular?
Restful Web Services have become popular due to the below-mentioned
reasons:
• Its heterogeneous language environment has made it very popular.
• It assists web applications in different programming languages for better
communication.
• The web applications reside in a variety of environments with the
assistance of Restful services.
REST Web Services
RESTful Web Services
• In the web services terms, REpresentational State Transfer (REST) is a
stateless client-server architecture in which the web services are viewed as
resources and can be identified by their URIs.
• Web service clients that want to use these resources access via globally
defined set of remote methods that describe the action to be performed on
the resource.
• In the REST architecture style, clients and servers exchange
representations of resources by using a standardized interface and
protocol.
• REST isn't protocol specific, but when people talk about REST they
usually mean REST over HTTP.
• The response from server is considered as the representation of the
resources (that can be generated from one resource or more number of
resources).
• RESTFul web services are based on HTTP methods and the concept of
REST. A RESTFul web service typically defines the base URI for the
services, the supported MIME-types (XML, text, JSON, user-defined, ...)
and the set of operations (POST, GET, PUT, DELETE) which are
supported. A concrete implementation of a REST Web service follows four
basic design principles:
Use HTTP methods explicitly.
Be stateless.
Expose directory structure-like URIs.
Transfer XML, JavaScript Object Notation (JSON), or both.
JAX-RS - Java API for RESTful Web Services, is a set of APIs to develop
REST service. JAX-RS is part of the Java EE, and make developers to
develop REST web application easily. There are two main implementation of
JAX-RS API: Jersey and RESTEasy Jersey is the open source, production
quality,
JAX-RS (JSR 311) Reference Implementation for building RESTful Web
services. But, it is also more than the Reference Implementation. Jersey
provides an API so that developers may extend Jersey to suit their needs.
Differences between SOAP and REST
No SOAP REST
1. SOAP is a protocol REST is an architectural style.
2. SOAP stands for Simple Object
Access Protocol.
REST stands for REpresentational State
Transfer.
3. SOAP can't use REST because it is a
protocol.
REST can use SOAP web services
because it is a concept and can use any
protocol like HTTP, SOAP
4. SOAP uses services interfaces to
expose the business logic
REST uses URI to expose business logic.
5. JAX-WS is the java API for SOAP
web services.
JAX-RS is the java API for RESTful web
services.
6. SOAP defines standards to be
strictly followed.
REST does not define too much
standards like SOAP.
7. SOAP requires more bandwidth
and resources than REST.
REST requires less bandwidth and
resources than SOAP.
8. SOAP defines its own security. RESTful web services inherits security
measures from the underlying
transport.
9. SOAP permits XML data format
only
REST permits different data format such
as Plain text, HTML, XML, JSON etc.
10. SOAP is less preferred than
REST
REST more preferred than SOAP
SOAP vs REST based Web Services
SOAP Web Services
Advantages:
WS Security: SOAP defines its own security known as WS Security which adds some
enterprise security features. Supports identity through intermediaries, not just point to point
(SSL). It also provides a standard implementation of data integrity and data privacy.
Atomic Transaction: SOAP supports ACID (Atomicity, Consistency, Isolation, Durability)
compliant transactions. Internet apps generally don’t need this level of transactional reliability,
enterprise apps sometimes do.
Reliable Messaging: SOAP has successful/retry logic built in and provides end-to-end
reliability even through SOAP intermediaries.
Disadvantages:
Slow: SOAP uses XML format that must be parsed to be read. It defines many
standards that must be followed while developing the SOAP applications.
So it is slow and consumes more bandwidth and resource.
WSDL dependent: SOAP uses WSDL and doesn't have any other mechanism
to discover the service.
RESTful Web Services
Advantages:
Fast: RESTful Web Services are fast because there is no strict
specification like SOAP. It consumes less bandwidth and resource.
Can use SOAP: RESTful web services can use SOAP web services as the
implementation.
Permits different data format: RESTful web service permits different
data format such as Plain Text, HTML, XML and JSON.
Disadvantages:
ACID Transactions: REST supports transactions, but it isn’t as comprehensive and
isn’t ACID compliant.
REST is limited by HTTP itself which can’t provide two-phase commit across
distributed transactional resources, but SOAP can.
WS Security: REST supports just a standard security technology for establishing an
encrypted link between a server and a client SSL (Secure Sockets Layer).
Reliable Messaging: REST doesn’t have a standard messaging system and expects
clients to deal with communication failures by retrying.
even though REST is more popular and preferable for Web apps and Web based
services, SOAP is still useful and important for some enterprise solutions and highly
reliable applications (e.g. bank clients, etc.)
REST Web Services are:
Modern
Light weight
Use a lot of concepts behind HTTP
When to choose REST?
• REST should be chosen when you have to develop a highly secure and
complex API, which supports different protocols.
• Although SOAP may be a good choice, REST may be better when you have
to develop lightweight APIs with great performance and support for CURD
operations.

More Related Content

What's hot (20)

PDF
Api presentation
Tiago Cardoso
 
PDF
Introdução APIs RESTful
Douglas V. Pasqua
 
PPTX
Weblogic application server
Anuj Tomar
 
PPTX
API Design- Best Practices
Prakash Bhandari
 
PDF
Introduction to API
rajnishjha29
 
PDF
Building Event Driven (Micro)services with Apache Kafka
Guido Schmutz
 
PDF
REST API Basics
Tharindu Weerasinghe
 
PPT
Soap Vs Rest
sreekveturi
 
ODP
Web service Introduction
Madhukar Kumar
 
PDF
Mejores prácticas de IAM
Amazon Web Services LATAM
 
PPT
Postman.ppt
ParrotBAD
 
PPTX
Soap vs rest
Antonio Severien
 
PPTX
Asynchronous programming in C#
Bohdan Pashkovskyi
 
PPTX
Web api
Sudhakar Sharma
 
PDF
Spring MVC
Aaron Schram
 
PPTX
Angular
sridhiya
 
PPTX
Front End Development | Introduction
JohnTaieb
 
PPT
Apache Web Server Architecture Chaitanya Kulkarni
webhostingguy
 
PDF
Automation with ansible
Khizer Naeem
 
PDF
Api security-testing
n|u - The Open Security Community
 
Api presentation
Tiago Cardoso
 
Introdução APIs RESTful
Douglas V. Pasqua
 
Weblogic application server
Anuj Tomar
 
API Design- Best Practices
Prakash Bhandari
 
Introduction to API
rajnishjha29
 
Building Event Driven (Micro)services with Apache Kafka
Guido Schmutz
 
REST API Basics
Tharindu Weerasinghe
 
Soap Vs Rest
sreekveturi
 
Web service Introduction
Madhukar Kumar
 
Mejores prácticas de IAM
Amazon Web Services LATAM
 
Postman.ppt
ParrotBAD
 
Soap vs rest
Antonio Severien
 
Asynchronous programming in C#
Bohdan Pashkovskyi
 
Spring MVC
Aaron Schram
 
Angular
sridhiya
 
Front End Development | Introduction
JohnTaieb
 
Apache Web Server Architecture Chaitanya Kulkarni
webhostingguy
 
Automation with ansible
Khizer Naeem
 
Api security-testing
n|u - The Open Security Community
 

Similar to REST Introduction.ppt (20)

PPTX
Mini-Training: Let's have a rest
Betclic Everest Group Tech Team
 
PPTX
REST & RESTful Web Services
Halil Burak Cetinkaya
 
PPTX
Rest surekha
Surekha Achanta
 
PPTX
REST & SOAP.pptx
ZawLwinTun2
 
PPTX
Rest api design
Rudra Tripathy
 
PDF
Lab7 paper
Damodar Sree Ranganath
 
PDF
Restful web services by Sreeni Inturi
Sreeni I
 
PPTX
RESTful APIs
Adi Challa
 
PDF
09-01-services-slides.pdf for educations
katariraju71
 
PDF
Secc tutorials development and deployment of rest web services in java_v2.0
Aravindharamanan S
 
PPTX
Unit 2
Ravi Kumar
 
PPTX
Restful web services ppt
OECLIB Odisha Electronics Control Library
 
PPTX
unit -4 spring web services like SOA Arch
sudharani127782
 
PDF
REST - Representational State Transfer
Peter R. Egli
 
PDF
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
IJIR JOURNALS IJIRUSA
 
PPTX
Overview of Rest Service and ASP.NET WEB API
Pankaj Bajaj
 
PDF
Modern REST API design principles and rules.pdf
Aparna Sharma
 
PDF
Restful web-services
rporwal
 
PDF
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
PPTX
Cordova training - Day 8 - REST API's
Binu Paul
 
Mini-Training: Let's have a rest
Betclic Everest Group Tech Team
 
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Rest surekha
Surekha Achanta
 
REST & SOAP.pptx
ZawLwinTun2
 
Rest api design
Rudra Tripathy
 
Restful web services by Sreeni Inturi
Sreeni I
 
RESTful APIs
Adi Challa
 
09-01-services-slides.pdf for educations
katariraju71
 
Secc tutorials development and deployment of rest web services in java_v2.0
Aravindharamanan S
 
Unit 2
Ravi Kumar
 
unit -4 spring web services like SOA Arch
sudharani127782
 
REST - Representational State Transfer
Peter R. Egli
 
Ijirsm ashok-kumar-ps-compulsiveness-of-res tful-web-services
IJIR JOURNALS IJIRUSA
 
Overview of Rest Service and ASP.NET WEB API
Pankaj Bajaj
 
Modern REST API design principles and rules.pdf
Aparna Sharma
 
Restful web-services
rporwal
 
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
Cordova training - Day 8 - REST API's
Binu Paul
 
Ad

More from KGSCSEPSGCT (12)

PPT
Introduction to Distributed Systems
KGSCSEPSGCT
 
PPT
Unit4_Managing Contracts.ppt
KGSCSEPSGCT
 
PPT
WSstandards.ppt
KGSCSEPSGCT
 
PPT
UDDI.ppt
KGSCSEPSGCT
 
PPT
ROA.ppt
KGSCSEPSGCT
 
PDF
3-SchemaExamples.pdf
KGSCSEPSGCT
 
PDF
Converting DTDs to XML Schemas.pdf
KGSCSEPSGCT
 
PDF
XSL- XSLT.pdf
KGSCSEPSGCT
 
PDF
XML-INTRODUCTION.pdf
KGSCSEPSGCT
 
PPT
XSLT.ppt
KGSCSEPSGCT
 
PPT
2-DTD.ppt
KGSCSEPSGCT
 
PDF
XML Schema.pdf
KGSCSEPSGCT
 
Introduction to Distributed Systems
KGSCSEPSGCT
 
Unit4_Managing Contracts.ppt
KGSCSEPSGCT
 
WSstandards.ppt
KGSCSEPSGCT
 
UDDI.ppt
KGSCSEPSGCT
 
ROA.ppt
KGSCSEPSGCT
 
3-SchemaExamples.pdf
KGSCSEPSGCT
 
Converting DTDs to XML Schemas.pdf
KGSCSEPSGCT
 
XSL- XSLT.pdf
KGSCSEPSGCT
 
XML-INTRODUCTION.pdf
KGSCSEPSGCT
 
XSLT.ppt
KGSCSEPSGCT
 
2-DTD.ppt
KGSCSEPSGCT
 
XML Schema.pdf
KGSCSEPSGCT
 
Ad

Recently uploaded (20)

PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Tally software_Introduction_Presentation
AditiBansal54083
 

REST Introduction.ppt

  • 1. REST based Web Services
  • 2. • Overall Web Services architecture consists of many layers including protocols and standards for security and reliability. • Therefore it becomes complicated and time/resource consuming for developers of simple web services. • Web Services can be implemented in Web environments too, on top of basic Web technologies such as HTTP, Simple Mail Transfer Protocol (SMTP), and so on.
  • 3. REpresentational State Transfer (REST) has gained widespread acceptance across the Web as a simpler alternative to SOAP and WSDL based Web services. 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.
  • 4. Simply put, it is the architecture of the Web. REST has emerged in the last several years alone as a predominant Web service design model. 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. REST is preferable in problem domains that are query intense or that require exchange of large grain chunks of data. Basically, you would want to use RESTful web services for integration over the web.
  • 5. SOAP and WSDL based Web services (“Big” Web services) are preferable in areas that require asynchrony and various qualities of services. Finally, SOAP-based custom interfaces enable straightforward creation of new services based on choreography. Therefore, you will use big web services in enterprise application integration scenarios that have advanced quality of service (QoS) requirements.
  • 6. What is REST? “Representational State Transfer is intended to evoke an image of how a well-designed web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page ( representing the next state of the application) being transferred to the user and rendered for their use.
  • 7. REST- An Architectural Style of Networked System Underlying Architectural model of the World Wide Web. Guiding framework for Web protocol standards.
  • 8. RESR based web services Online shopping Search services Dictionary services.
  • 9. Characteristics of a REST based network Client-Server: a pull-based interaction style (Client request data from servers as and when needed). 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. Cache: to improve network efficiency, responses must be capable of being labelled as caheable or non-cacheable. Uniform interface: all resources are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE).
  • 10. Named resources: the system is comprised of resources which are named using a URL. Interconnected resource representation: the representations of the resources are interconnected using URLs, thereby enabling a client to progress from one state to another. The characteristics of the restful web services are as below: The restful web services have a pull-based client-server interaction manner. Every request from the client to the server must possess the required data to understand the request and it cannot take the profit of any saved content on the server. To advance or develop the network efficiency outputs it must be capable of being labelled as cacheable or non-cacheable.
  • 11. Principles of REST web service design • Identify all the conceptual entities that we wish to expose as services. (Examples we saw include resources such as : parts list, detailed part data, purchase order) • Create a URL to each resource. • Categorize our resources according to whether clients can just receive a representation of the resource (using an HTTP GET), or whether clients can modify (add to) the resource using HTTP POST, PUT and/or DELETE).
  • 12. • 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. • Put hyperlinks within resource representations to enable clients to drill down for more information, and/or to obtain related information. • Design to reveal data gradually. Don’t reveal everything in a single response document. Provide hyperlinks to obtain more details. • 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. • Describe how our services are to be invoked using either a WDL document or simply an HTML document.
  • 13. Principles of Restful Web Services: The principles of the restful web services are as follows: • REST network is a key for designing the web services. • It requires or needs to create a URL for every device. • The resources have to be arranged in a format that helps the client. • The resources accessible through HTTP should be free of side effect. • The hyperlinks should be kept within the representation of resources. • The design should be in a manner that reveals the information gradually.
  • 14. Advantages of Restful Web Services: The advantages of restful web services are as follows: • The restful web services have the scalable equipment interactions. • It possesses the general interfaces. • It can independently deploy the connections. • It decreases the interaction latency. • It strengthens or improves the security. • It has the feature of safe encapsulation of legacy systems. • It sustains the proxies and gateways as information transformation and caching equipment. • Restful web services scale to a huge number of clients. • It enables the alienate of information in streams that possess infinite size.
  • 15. Disadvantages of Restful Web Services: The disadvantages of restful web services are as follows: • It destroys few advantages of other architectures. • Restful web services have a state of interaction with an FTP site. • It contains a single interface for everything. • It reduces the performances of the new by enhancing the repetitive information.
  • 16. Why are Restful Web Services so popular? Restful Web Services have become popular due to the below-mentioned reasons: • Its heterogeneous language environment has made it very popular. • It assists web applications in different programming languages for better communication. • The web applications reside in a variety of environments with the assistance of Restful services.
  • 18. RESTful Web Services • In the web services terms, REpresentational State Transfer (REST) is a stateless client-server architecture in which the web services are viewed as resources and can be identified by their URIs. • Web service clients that want to use these resources access via globally defined set of remote methods that describe the action to be performed on the resource.
  • 19. • In the REST architecture style, clients and servers exchange representations of resources by using a standardized interface and protocol. • REST isn't protocol specific, but when people talk about REST they usually mean REST over HTTP. • The response from server is considered as the representation of the resources (that can be generated from one resource or more number of resources).
  • 20. • RESTFul web services are based on HTTP methods and the concept of REST. A RESTFul web service typically defines the base URI for the services, the supported MIME-types (XML, text, JSON, user-defined, ...) and the set of operations (POST, GET, PUT, DELETE) which are supported. A concrete implementation of a REST Web service follows four basic design principles: Use HTTP methods explicitly. Be stateless. Expose directory structure-like URIs. Transfer XML, JavaScript Object Notation (JSON), or both.
  • 21. JAX-RS - Java API for RESTful Web Services, is a set of APIs to develop REST service. JAX-RS is part of the Java EE, and make developers to develop REST web application easily. There are two main implementation of JAX-RS API: Jersey and RESTEasy Jersey is the open source, production quality, JAX-RS (JSR 311) Reference Implementation for building RESTful Web services. But, it is also more than the Reference Implementation. Jersey provides an API so that developers may extend Jersey to suit their needs.
  • 22. Differences between SOAP and REST No SOAP REST 1. SOAP is a protocol REST is an architectural style. 2. SOAP stands for Simple Object Access Protocol. REST stands for REpresentational State Transfer. 3. SOAP can't use REST because it is a protocol. REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP 4. SOAP uses services interfaces to expose the business logic REST uses URI to expose business logic. 5. JAX-WS is the java API for SOAP web services. JAX-RS is the java API for RESTful web services.
  • 23. 6. SOAP defines standards to be strictly followed. REST does not define too much standards like SOAP. 7. SOAP requires more bandwidth and resources than REST. REST requires less bandwidth and resources than SOAP. 8. SOAP defines its own security. RESTful web services inherits security measures from the underlying transport. 9. SOAP permits XML data format only REST permits different data format such as Plain text, HTML, XML, JSON etc. 10. SOAP is less preferred than REST REST more preferred than SOAP
  • 24. SOAP vs REST based Web Services SOAP Web Services Advantages: WS Security: SOAP defines its own security known as WS Security which adds some enterprise security features. Supports identity through intermediaries, not just point to point (SSL). It also provides a standard implementation of data integrity and data privacy. Atomic Transaction: SOAP supports ACID (Atomicity, Consistency, Isolation, Durability) compliant transactions. Internet apps generally don’t need this level of transactional reliability, enterprise apps sometimes do. Reliable Messaging: SOAP has successful/retry logic built in and provides end-to-end reliability even through SOAP intermediaries.
  • 25. Disadvantages: Slow: SOAP uses XML format that must be parsed to be read. It defines many standards that must be followed while developing the SOAP applications. So it is slow and consumes more bandwidth and resource. WSDL dependent: SOAP uses WSDL and doesn't have any other mechanism to discover the service.
  • 26. RESTful Web Services Advantages: Fast: RESTful Web Services are fast because there is no strict specification like SOAP. It consumes less bandwidth and resource. Can use SOAP: RESTful web services can use SOAP web services as the implementation. Permits different data format: RESTful web service permits different data format such as Plain Text, HTML, XML and JSON.
  • 27. Disadvantages: ACID Transactions: REST supports transactions, but it isn’t as comprehensive and isn’t ACID compliant. REST is limited by HTTP itself which can’t provide two-phase commit across distributed transactional resources, but SOAP can. WS Security: REST supports just a standard security technology for establishing an encrypted link between a server and a client SSL (Secure Sockets Layer). Reliable Messaging: REST doesn’t have a standard messaging system and expects clients to deal with communication failures by retrying. even though REST is more popular and preferable for Web apps and Web based services, SOAP is still useful and important for some enterprise solutions and highly reliable applications (e.g. bank clients, etc.)
  • 28. REST Web Services are: Modern Light weight Use a lot of concepts behind HTTP
  • 29. When to choose REST? • REST should be chosen when you have to develop a highly secure and complex API, which supports different protocols. • Although SOAP may be a good choice, REST may be better when you have to develop lightweight APIs with great performance and support for CURD operations.