SlideShare a Scribd company logo
BY
CM.UVASHREE
MSC-CS
DEPARTMENT OF CS&IT
NADAR SARASWATHI COLLEGE OF
ARTS AND SCIENCE
web programming
.
What is soap?
SOAP is an acronym for Simple Object
Access Protocol.
It is an XML-based messaging protocol
for exchanging information among
computers.
SOAP is an application of the XML
specification,
SOAP is platform independent.
SOAP is a protocol or in other words is
a definition of how web services talk to
each other or talk to client applications
that invoke them.
web programming
Why soap?
It is important for web applications to be
able to communicate over the Internet.
The best way to communicate between
applications is over HTTP, because HTTP is
supported by all Internet browsers and
servers. SOAP was created to accomplish
this.
SOAP provides a way to communicate
between applications running on different
operating systems, with different
technologies and programming languages.
A SOAP message is an ordinary XML document
containing the following elements −
•Envelope − Defines the start and the end of the
message. It is a mandatory element.
•Header − Contains any optional attributes of the
message used in processing the message, either at an
intermediary point or at the ultimate end-point. It is an
optional element.
•Body − Contains the XML data comprising the
message being sent. It is a mandatory element.
•Fault − An optional Fault element that provides
information about errors that occur while processing
the message.
Soap Building Blocks
web programming
Here are some important syntax rules:
A SOAP message MUST be encoded
using XML
A SOAP message MUST use the SOAP
Envelope namespace
A SOAP message must NOT contain a
DTD reference
A SOAP message must NOT contain
XML Processing Instructions
Syntax Rules
Skeleton SOAP Message
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-
envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-
encoding">
<soap:Header>
...
</soap:Header>
<soap:Body>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
Skeleton SOAP Message
SOAP -Envelop
 The SOAP envelope solves the problem of knowing
when you are done receiving a message and are
ready to process it.
 The SOAP envelope is therefore basically a
packaging mechanism.
<?xml version = "1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle = " http://www.w3.org/2001/12/soap-
encoding">
...
Message information goes here
...
</SOAP-ENV:Envelope>
SOAP Header
The optional Header element offers a flexible
framework for specifying additional application
level requirements.
It contains application_specify information(like
authentication,payment,etc)(about the SOAP
message.
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Header>
<m:Trans xmlns:m="https://www.w3schools.com/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>
SOAP-Body
The required SOAP Body element contains the actual SOAP
message intended for the ultimate endpoint of the message.
Immediate child elements of the SOAP Body element may be
namespace-qualified.
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-
encoding">
<soap:Body>
<m:GetPrice xmlns:m="https://www.w3schools.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope>
The optional SOAP Fault element is used to
indicate error messages.
The SOAP Fault element holds errors and status
information for a SOAP message.
If a Fault element is present, it must appear as a
child element of the Body element. A Fault element
can only appear once in a SOAP message.
The SOAP Fault element has the following sub
elements
SOAP Fault Element
Sub Element Description
<faultcode> A code for identifying the fault
<faultstring> A human readable explanation of the fault
<faultactor> Information about who caused the fault to
happen
<detail> Holds application specific error information
related to the Body element
web programming
web programming
web programming
GET: The HTTP GET method is used to read (or
retrieve) a representation of a resource. In the
safe path, GET returns a representation in XML
or JSON and an HTTP response code of 200
(OK). In an error case, it most often returns a 404
(NOT FOUND) or 400 (BAD REQUEST).
POST: The POST verb is most-often utilized
to create new resources. In particular, it’s used to
create subordinate resources. That is, subordinate
to some other (e.g. parent) resource. On successful
creation, return HTTP status 201, returning a
Location header with a link to the newly-created
resource with the 201 HTTP status.
PUT: It is used for updating the capabilities. However,
PUT can also be used to create a resource in the case where
the resource ID is chosen by the client instead of by the
server. In other words, if the PUT is to a URI that contains
the value of a non-existent resource ID. On successful
update, return 200 (or 204 if not returning any content in
the body) from a PUT. If using PUT for create, return
HTTP status 201 on successful creation. PUT is not safe
operation but it’s idempotent.
DELETE: It is used to delete a resource identified by
a URI. On successful deletion, return HTTP status 200
(OK) along with a response body.
Advantages of REST
•Resource-based. A primary benefit of using REST,
from both a client and server perspective, is that REST
interactions are based on constructs which are familiar
to anyone accustomed to using HTTP. Employing a
resource-based approach, REST defines how
developers interact with web services.
Communication: REST-based interactions
communicate their status through numerical
HTTP status codes. REST APIs use these HTTP
status codes to detect errors and ease the API
monitoring process. They include the following:
•404 error indicates that a requested resource wasn't
found;
•401 status response code is triggered by an
unauthorized request;
•200 status response code indicates that a request was
successful; and
•500 error signals an unrecoverable application fault on
the server.
Language-independent:When creating RESTful APIs
or web services, developers can employ any
language that uses HTTP to make web-based
requests. This capability makes it easy for
programmers to choose the technologies they
prefer to work with and that best suit their
needs.
Disadvantage of rest
Architecture. Developers working with REST frequently
encounter limitations due to its architecture design. These
include multiplexing multiple requests over a single TCP
connection, having different resource requests for each
resource file, server request uploads, and long HTTP
request headers, which cause delays in webpage loading.
Stateless application: since HTTP does not store state-
based information between request-response cycles, the
client must perform state management tasks. This makes
it difficult for programmers to implement server updates
without the use of client-side polling or other types of
webhooks that send data and executable commands from
one app to another.
What is JSON?
JSON or JavaScript Object Notation is a lightweight text-based
open standard designed for human-readable data interchange.
Conventions used by JSON are known to programmers, which
include C, C++, Java, Python, Perl, etc.
•JSON stands for JavaScript Object Notation.
•The format was specified by Douglas Crockford.
•It was designed for human-readable data interchange.
•It has been extended from the JavaScript scripting language.
•The filename extension is .json.
•JSON Internet Media type is application/json.
•The Uniform Type Identifier is public.json.
•It is used while writing JavaScript based
applications that includes browser extensions
and websites.
•JSON format is used for serializing and
transmitting structured data over network
connection.
•It is primarily used to transmit data between a
server and web applications.
•Web services and APIs use JSON format to
provide public data.
•It can be used with modern programming
languages.
USES OF JSON
•Simplicity
•Openness
•Self-Describing
•Internationalization
•Extensibility
•Interoperability
Features of JSON
.JSON is easy to read and write.
It is a lightweight text-based interchange
format.
JSON is language independent.
Characteristics of JSON
Data is in name/value pairs
Data is separated by commas
Curly braces hold objects
Square brackets hold arrays
JSON Syntax Rules
This example defines an employees object: an
array of 3 employee records (objects):
{
"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]
}
jSON Example
JSON supports the following two data
structures −
•Collection of name/value pairs − This Data
Structure is supported by different
programming languages.
•Ordered list of values − It includes array, list,
vector or sequence etc.
CONT…
Sr.N
o.
Type & Description
1 Number
double- precision floating-point format in JavaScript
2 String
double-quoted Unicode with backslash escaping
3 Boolean
true or false
4 Array
an ordered sequence of values
5 Value
it can be a string, a number, true or false, null etc
6 Object
an unordered collection of key:value pairs
7 Whitespace
can be used between any pair of tokens
8 null
empty
JSON format supports the following data
types
{
“name”:”ram”
“gender”:”male”
“age”:25,
“is married”:false,
“marks”:[95,78,35,88,85],
“average”:74.0,
“hobbies”:null,
“address”:{
“street”:”cherry road”,
“city”:”salem”,
“pincode”:636007
}
}
Here are some common applications of JSON:
o Helps you to transfer data from a server
o Sample JSON file format helps in transmit and serialize all types
of structured data.
o Allows you to perform asynchronous data calls without the need
to do a page refresh
o Helps you to transmit data between a server and web
applications.
o It is widely used for JavaScript-based application, which includes
browser extension and websites.
o You can transmit data between the server and web application
using JSON.
o We can use JSON with modern programming languages.
o It is used for writing JavaScript-based applications that include
browser add-ons.
o Web services and Restful APIs use the JSON format to get public
data.
Application of JSON
It is JavaScript Object Notation It is Extensible markup language
It is based on JavaScript language. It is derived from SGML.
It is a way of representing objects.
It is a markup language and uses tag
structure to represent data items.
It does not provides any support for
namespaces.
It supports namespaces.
It supports array. It doesn’t supports array.
Its files are very easy to read as
compared to XML.
Its documents are comparatively
difficult to read and interpret.
It doesn’t use end tag. It has start and end tags.
It is less secured. It is more secured than JSON.
It doesn’t supports comments. It supports comments.
It supports only UTF-8 encoding. It supports various encoding.
XML
JSON
web programming

More Related Content

What's hot (20)

PPTX
Mule enricher
Ravinder Singh
 
PPTX
Mule enricher
Karnam Karthik
 
PPTX
Siteimprove TechTalk: Demystifying Accessible Names
Tobias Christian Jensen
 
PDF
Ch1 computer networks internet_encapsulation_4
Syed Ariful Islam Emon
 
PDF
Unit 5 application layer
Kritika Purohit
 
PPT
COMPUTER NETWORKS UNIT 5
BON SECOURS COLLEGE FOR WOMEN
 
PPTX
Java Input and Output
Ducat India
 
PPT
Jaimin chp-7 - application layer- 2011 batch
Jaimin Jani
 
PPT
Chapter 4 a interprocess communication
AbDul ThaYyal
 
PPTX
Protocols
ShubhamMishra485
 
PPT
Chapter3
siageoksoon
 
PDF
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
Jitendra Bafna
 
PPTX
Application layer
reshmadayma
 
PDF
CS6601 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 
DOCX
Bt0076, tcpip
smumbahelp
 
PPTX
Electronic Mail
Owaîs Járå
 
PDF
Email forensic
Sakib Khan
 
PPTX
Networking presentation
Pushkar Mishra
 
DOCX
Bnt403 web technologies
smumbahelp
 
Mule enricher
Ravinder Singh
 
Mule enricher
Karnam Karthik
 
Siteimprove TechTalk: Demystifying Accessible Names
Tobias Christian Jensen
 
Ch1 computer networks internet_encapsulation_4
Syed Ariful Islam Emon
 
Unit 5 application layer
Kritika Purohit
 
COMPUTER NETWORKS UNIT 5
BON SECOURS COLLEGE FOR WOMEN
 
Java Input and Output
Ducat India
 
Jaimin chp-7 - application layer- 2011 batch
Jaimin Jani
 
Chapter 4 a interprocess communication
AbDul ThaYyal
 
Protocols
ShubhamMishra485
 
Chapter3
siageoksoon
 
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
Jitendra Bafna
 
Application layer
reshmadayma
 
CS6601 DISTRIBUTED SYSTEMS
Kathirvel Ayyaswamy
 
Bt0076, tcpip
smumbahelp
 
Electronic Mail
Owaîs Járå
 
Email forensic
Sakib Khan
 
Networking presentation
Pushkar Mishra
 
Bnt403 web technologies
smumbahelp
 

Similar to web programming (20)

PPTX
Soap,Rest&Json
DEEPIKA T
 
PDF
What is API - Understanding API Simplified
Jubin Aghara
 
PDF
Ebook undisturbed rest-v1 [res_tful apis]
johnkbutcher
 
PPT
Intro to web services
Neil Ghosh
 
PPTX
What is an API?
Muhammad Zuhdi
 
PDF
WIT UNIT-5.pdf
jashmithakakavakam
 
PPTX
Web Service
Ashwani kumar
 
PPTX
Web Programming
VijayapriyaP1
 
PDF
Api Penetration Testing and web app pentesting
<h1> hi</h1>
 
PPTX
Apitesting.pptx
NamanVerma88
 
PDF
Introduction to SOAP
Safwan Hashmi
 
ODP
Web service Introduction
Madhukar Kumar
 
PPTX
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
KEY
A Conversation About REST - Extended Version
Jeremy Brown
 
PDF
Rest API Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
Introduction to APIs (Application Programming Interface)
Vibhawa Nirmal
 
DOCX
Rest vs soap
Naseers
 
PPTX
Автоматизация тестирования API для начинающих
COMAQA.BY
 
PDF
Introduction to SOAP
Hayati Guvence
 
PPTX
SOAP - Simple Object Access Protocol
Anushka Patil
 
Soap,Rest&Json
DEEPIKA T
 
What is API - Understanding API Simplified
Jubin Aghara
 
Ebook undisturbed rest-v1 [res_tful apis]
johnkbutcher
 
Intro to web services
Neil Ghosh
 
What is an API?
Muhammad Zuhdi
 
WIT UNIT-5.pdf
jashmithakakavakam
 
Web Service
Ashwani kumar
 
Web Programming
VijayapriyaP1
 
Api Penetration Testing and web app pentesting
<h1> hi</h1>
 
Apitesting.pptx
NamanVerma88
 
Introduction to SOAP
Safwan Hashmi
 
Web service Introduction
Madhukar Kumar
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
A Conversation About REST - Extended Version
Jeremy Brown
 
Rest API Interview Questions PDF By ScholarHat
Scholarhat
 
Introduction to APIs (Application Programming Interface)
Vibhawa Nirmal
 
Rest vs soap
Naseers
 
Автоматизация тестирования API для начинающих
COMAQA.BY
 
Introduction to SOAP
Hayati Guvence
 
SOAP - Simple Object Access Protocol
Anushka Patil
 
Ad

More from shreeuva (9)

PPTX
software engineering
shreeuva
 
PPTX
Business intelligence
shreeuva
 
PPTX
recovery system
shreeuva
 
PPTX
operating system
shreeuva
 
PPTX
network security and tls
shreeuva
 
PPTX
Datamining spatial database
shreeuva
 
PPTX
Encoding1
shreeuva
 
PDF
jdbc
shreeuva
 
PPTX
prim's and kruskal's algorithm
shreeuva
 
software engineering
shreeuva
 
Business intelligence
shreeuva
 
recovery system
shreeuva
 
operating system
shreeuva
 
network security and tls
shreeuva
 
Datamining spatial database
shreeuva
 
Encoding1
shreeuva
 
jdbc
shreeuva
 
prim's and kruskal's algorithm
shreeuva
 
Ad

Recently uploaded (20)

PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
Horarios de distribución de agua en julio
pegazohn1978
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Introduction presentation of the patentbutler tool
MIPLM
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 

web programming

  • 1. BY CM.UVASHREE MSC-CS DEPARTMENT OF CS&IT NADAR SARASWATHI COLLEGE OF ARTS AND SCIENCE
  • 3. . What is soap? SOAP is an acronym for Simple Object Access Protocol. It is an XML-based messaging protocol for exchanging information among computers. SOAP is an application of the XML specification, SOAP is platform independent. SOAP is a protocol or in other words is a definition of how web services talk to each other or talk to client applications that invoke them.
  • 5. Why soap? It is important for web applications to be able to communicate over the Internet. The best way to communicate between applications is over HTTP, because HTTP is supported by all Internet browsers and servers. SOAP was created to accomplish this. SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
  • 6. A SOAP message is an ordinary XML document containing the following elements − •Envelope − Defines the start and the end of the message. It is a mandatory element. •Header − Contains any optional attributes of the message used in processing the message, either at an intermediary point or at the ultimate end-point. It is an optional element. •Body − Contains the XML data comprising the message being sent. It is a mandatory element. •Fault − An optional Fault element that provides information about errors that occur while processing the message. Soap Building Blocks
  • 8. Here are some important syntax rules: A SOAP message MUST be encoded using XML A SOAP message MUST use the SOAP Envelope namespace A SOAP message must NOT contain a DTD reference A SOAP message must NOT contain XML Processing Instructions Syntax Rules
  • 9. Skeleton SOAP Message <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap- envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap- encoding"> <soap:Header> ... </soap:Header> <soap:Body> ... <soap:Fault> ... </soap:Fault> </soap:Body> </soap:Envelope> Skeleton SOAP Message
  • 10. SOAP -Envelop  The SOAP envelope solves the problem of knowing when you are done receiving a message and are ready to process it.  The SOAP envelope is therefore basically a packaging mechanism. <?xml version = "1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope" SOAP-ENV:encodingStyle = " http://www.w3.org/2001/12/soap- encoding"> ... Message information goes here ... </SOAP-ENV:Envelope>
  • 11. SOAP Header The optional Header element offers a flexible framework for specifying additional application level requirements. It contains application_specify information(like authentication,payment,etc)(about the SOAP message. <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"> <soap:Header> <m:Trans xmlns:m="https://www.w3schools.com/transaction/" soap:mustUnderstand="1">234 </m:Trans> </soap:Header> ... ... </soap:Envelope>
  • 12. SOAP-Body The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message. Immediate child elements of the SOAP Body element may be namespace-qualified. <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope/" soap:encodingStyle="http://www.w3.org/2003/05/soap- encoding"> <soap:Body> <m:GetPrice xmlns:m="https://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> </soap:Envelope>
  • 13. The optional SOAP Fault element is used to indicate error messages. The SOAP Fault element holds errors and status information for a SOAP message. If a Fault element is present, it must appear as a child element of the Body element. A Fault element can only appear once in a SOAP message. The SOAP Fault element has the following sub elements SOAP Fault Element
  • 14. Sub Element Description <faultcode> A code for identifying the fault <faultstring> A human readable explanation of the fault <faultactor> Information about who caused the fault to happen <detail> Holds application specific error information related to the Body element
  • 18. GET: The HTTP GET method is used to read (or retrieve) a representation of a resource. In the safe path, GET returns a representation in XML or JSON and an HTTP response code of 200 (OK). In an error case, it most often returns a 404 (NOT FOUND) or 400 (BAD REQUEST). POST: The POST verb is most-often utilized to create new resources. In particular, it’s used to create subordinate resources. That is, subordinate to some other (e.g. parent) resource. On successful creation, return HTTP status 201, returning a Location header with a link to the newly-created resource with the 201 HTTP status.
  • 19. PUT: It is used for updating the capabilities. However, PUT can also be used to create a resource in the case where the resource ID is chosen by the client instead of by the server. In other words, if the PUT is to a URI that contains the value of a non-existent resource ID. On successful update, return 200 (or 204 if not returning any content in the body) from a PUT. If using PUT for create, return HTTP status 201 on successful creation. PUT is not safe operation but it’s idempotent. DELETE: It is used to delete a resource identified by a URI. On successful deletion, return HTTP status 200 (OK) along with a response body.
  • 20. Advantages of REST •Resource-based. A primary benefit of using REST, from both a client and server perspective, is that REST interactions are based on constructs which are familiar to anyone accustomed to using HTTP. Employing a resource-based approach, REST defines how developers interact with web services. Communication: REST-based interactions communicate their status through numerical HTTP status codes. REST APIs use these HTTP status codes to detect errors and ease the API monitoring process. They include the following:
  • 21. •404 error indicates that a requested resource wasn't found; •401 status response code is triggered by an unauthorized request; •200 status response code indicates that a request was successful; and •500 error signals an unrecoverable application fault on the server. Language-independent:When creating RESTful APIs or web services, developers can employ any language that uses HTTP to make web-based requests. This capability makes it easy for programmers to choose the technologies they prefer to work with and that best suit their needs.
  • 22. Disadvantage of rest Architecture. Developers working with REST frequently encounter limitations due to its architecture design. These include multiplexing multiple requests over a single TCP connection, having different resource requests for each resource file, server request uploads, and long HTTP request headers, which cause delays in webpage loading. Stateless application: since HTTP does not store state- based information between request-response cycles, the client must perform state management tasks. This makes it difficult for programmers to implement server updates without the use of client-side polling or other types of webhooks that send data and executable commands from one app to another.
  • 23. What is JSON? JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc. •JSON stands for JavaScript Object Notation. •The format was specified by Douglas Crockford. •It was designed for human-readable data interchange. •It has been extended from the JavaScript scripting language. •The filename extension is .json. •JSON Internet Media type is application/json. •The Uniform Type Identifier is public.json.
  • 24. •It is used while writing JavaScript based applications that includes browser extensions and websites. •JSON format is used for serializing and transmitting structured data over network connection. •It is primarily used to transmit data between a server and web applications. •Web services and APIs use JSON format to provide public data. •It can be used with modern programming languages. USES OF JSON
  • 26. .JSON is easy to read and write. It is a lightweight text-based interchange format. JSON is language independent. Characteristics of JSON Data is in name/value pairs Data is separated by commas Curly braces hold objects Square brackets hold arrays JSON Syntax Rules
  • 27. This example defines an employees object: an array of 3 employee records (objects): { "employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ] } jSON Example
  • 28. JSON supports the following two data structures − •Collection of name/value pairs − This Data Structure is supported by different programming languages. •Ordered list of values − It includes array, list, vector or sequence etc. CONT…
  • 29. Sr.N o. Type & Description 1 Number double- precision floating-point format in JavaScript 2 String double-quoted Unicode with backslash escaping 3 Boolean true or false 4 Array an ordered sequence of values 5 Value it can be a string, a number, true or false, null etc 6 Object an unordered collection of key:value pairs 7 Whitespace can be used between any pair of tokens 8 null empty JSON format supports the following data types
  • 31. Here are some common applications of JSON: o Helps you to transfer data from a server o Sample JSON file format helps in transmit and serialize all types of structured data. o Allows you to perform asynchronous data calls without the need to do a page refresh o Helps you to transmit data between a server and web applications. o It is widely used for JavaScript-based application, which includes browser extension and websites. o You can transmit data between the server and web application using JSON. o We can use JSON with modern programming languages. o It is used for writing JavaScript-based applications that include browser add-ons. o Web services and Restful APIs use the JSON format to get public data. Application of JSON
  • 32. It is JavaScript Object Notation It is Extensible markup language It is based on JavaScript language. It is derived from SGML. It is a way of representing objects. It is a markup language and uses tag structure to represent data items. It does not provides any support for namespaces. It supports namespaces. It supports array. It doesn’t supports array. Its files are very easy to read as compared to XML. Its documents are comparatively difficult to read and interpret. It doesn’t use end tag. It has start and end tags. It is less secured. It is more secured than JSON. It doesn’t supports comments. It supports comments. It supports only UTF-8 encoding. It supports various encoding. XML JSON