SlideShare a Scribd company logo
2
Most read
3
Most read
9
Most read
SOAP vs. REST
SOAP to wash and REST to relax




           Antonio Loureiro Severien
                   FIB-UPC
What is SOAP?
 SOAP: Simple Object Access Protocol
  is a protocol for exchange of
  structured information on a
  decentralized and distributed platform
  using XML (eXtensible Markup
  Language)
 Works mainly with RPC (Remote
  Procedure Call) and HTTP (HyperText
  Transfer Protocol)
 HTTP makes SOAP go around
SOAP structure
              3 parts message: Envelope, Header,
               Body
                         POST /InStock HTTP/1.1
ENVELOPE                 Host: www.example.org
                         Content-Type: application/soap+xml; charset=utf-8       HTT
HEADER                   Content-Length: 299
                         SOAPAction: "http://www.w3.org/2003/05/soap-envelope"
                                                                                 P

                         <?xml version="1.0"?>
                         <soap:Envelope
BODY
                              xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
                          <soap:Header>
                          </soap:Header>
                          <soap:Body>
                           <m:GetStockPrice xmlns:m="http://www.example.org/stock">
 FAULT                      <m:StockName>IBM</m:StockName>
                           </m:GetStockPrice>
                          </soap:Body>
                         </soap:Envelope>
Simple Example
                                                    REQUEST
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body xmlns:m="http://www.example.org/stock">
 <m:GetStockPrice>
  <m:StockName>IBM</m:StockName>
 </m:GetStockPrice>
</soap:Body>

</soap:Envelope>
Simple Example
                                                    RESPONSE
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body xmlns:m="http://www.example.org/stock">
 <m:GetStockPriceResponse>
  <m:Price>34.5</m:Price>
 </m:GetStockPriceResponse>
</soap:Body>

</soap:Envelope>
SOAP Characteristics, Pros and
Cons
 Implements its own protocol
 Exposes pieces of application logic,
  operations
 Advantages
    ◦ Versatile in use of different application
      protocols
    ◦ Tunnels easily through firewalls due to the
      use of HTTP model
   Disadvantages
    ◦ Slower when using large XML messages
What is REST?
 REST: Representational State
  Transfer focuses on accessing named
  resources through a consistent
  interface
 Every resource has its representation
  (could be a document) and the
  resource state changes when some
  method is applied through a request
  using any vocabulary
Constraints and Principles
 Client-server
 Cacheable
 Stateless
 Uniform interface


 Identification of resources
 Manipulation of resources
 Self-descriptive messages
SOAP vs. REST
   SOAP RPC: Application designers have
    to build up their protocol vocabulary
    whereas in REST it uses the well known
    vocabulary of the protocol in use
   REST: Different data formats where
    SOAP only allows XML
   REST has support for JSON, uses
    standard HTTP
   REST better performance and scalability
   SOAP reads cannot be cached
When to wash? When to
relax?
   SOAP
    ◦   WS-Security: enterprise security features
    ◦   WS-AtomicTransactions: ACID compliant
    ◦   WS-ReliableMessaging: end-to-end reliability
    ◦   Ex.: smartphone app that communicates with
        a bank app on the web, need the previous
        implementations
   REST
    ◦ Lightweight
    ◦ Less complex for maintenance
    ◦ Bring the “web” back to web services
Reference
   http://www.w3schools.com/soap/default.asp
   http://en.wikipedia.org/wiki/Representational_State
    _Transfer
   http://en.wikipedia.org/wiki/SOAP
   http://www.crummy.com/writing/RESTful-Web-
    Services/
   http://tomayko.com/writings/rest-to-my-wife

More Related Content

PPTX
An Overview of Web Services: SOAP and REST
PPTX
jQuery
PPTX
Transformer ppt
PPTX
Introduction to Web Architecture
PPTX
Web Performance Optimization
PPTX
Api testing
PPTX
Web 2.0
An Overview of Web Services: SOAP and REST
jQuery
Transformer ppt
Introduction to Web Architecture
Web Performance Optimization
Api testing
Web 2.0

What's hot (20)

PPTX
SOAP - Simple Object Access Protocol
PPTX
Simple object access protocol(soap )
PDF
SOAP-based Web Services
PDF
API : l'architecture REST
PPTX
PPSX
Rest api standards and best practices
PDF
SOAP vs REST
PDF
REST API and CRUD
PPTX
An Introduction To REST API
PPT
Understanding REST
PPTX
PDF
Introduction to ASP.NET Core
PPTX
REST API
PPTX
REST & RESTful Web Services
PPTX
Reactjs
PDF
RPC에서 REST까지 간단한 개념소개
PPT
Introduction to the Web API
PPTX
PPTX
RESTful API - Best Practices
SOAP - Simple Object Access Protocol
Simple object access protocol(soap )
SOAP-based Web Services
API : l'architecture REST
Rest api standards and best practices
SOAP vs REST
REST API and CRUD
An Introduction To REST API
Understanding REST
Introduction to ASP.NET Core
REST API
REST & RESTful Web Services
Reactjs
RPC에서 REST까지 간단한 개념소개
Introduction to the Web API
RESTful API - Best Practices
Ad

Similar to Soap vs rest (20)

DOCX
Soap.doc
PPTX
WebServices introduction
PPTX
Introduction to WebServices
PDF
Java Web Services [2/5]: Introduction to SOAP
PPTX
PPTX
Introduction to WebServices
PPTX
Mule Webservices
PPTX
WebServices Basic Overview
PPTX
WebServices Basic Overview
PDF
Introduction to SOAP
PDF
REST vs SOAP
PPTX
Simple Object Access Protocol
KEY
CSG 2012
PPT
SOAP Overview
PDF
Esri Web Applications February11 2011
PPTX
Soap xp-wg
PPTX
Web-Services!.pptx
PDF
Restful Web Services
PPTX
Web Services
PDF
Intercloud interoperability
Soap.doc
WebServices introduction
Introduction to WebServices
Java Web Services [2/5]: Introduction to SOAP
Introduction to WebServices
Mule Webservices
WebServices Basic Overview
WebServices Basic Overview
Introduction to SOAP
REST vs SOAP
Simple Object Access Protocol
CSG 2012
SOAP Overview
Esri Web Applications February11 2011
Soap xp-wg
Web-Services!.pptx
Restful Web Services
Web Services
Intercloud interoperability
Ad

More from Antonio Severien (6)

PDF
Scalable Distributed Real-Time Clustering for Big Data Streams
PDF
Scalable Distributed Real-Time Clustering for Big Data Streams
PPTX
NoSQL: Cassadra vs. HBase
PDF
On Pragmatism and Scientific Freedom
PDF
Community cloud antonioseverien
PDF
Relational Cloud
Scalable Distributed Real-Time Clustering for Big Data Streams
Scalable Distributed Real-Time Clustering for Big Data Streams
NoSQL: Cassadra vs. HBase
On Pragmatism and Scientific Freedom
Community cloud antonioseverien
Relational Cloud

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Cloud computing and distributed systems.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Cloud computing and distributed systems.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
20250228 LYD VKU AI Blended-Learning.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Review of recent advances in non-invasive hemoglobin estimation
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....

Soap vs rest

  • 1. SOAP vs. REST SOAP to wash and REST to relax Antonio Loureiro Severien FIB-UPC
  • 2. What is SOAP?  SOAP: Simple Object Access Protocol is a protocol for exchange of structured information on a decentralized and distributed platform using XML (eXtensible Markup Language)  Works mainly with RPC (Remote Procedure Call) and HTTP (HyperText Transfer Protocol)  HTTP makes SOAP go around
  • 3. SOAP structure  3 parts message: Envelope, Header, Body POST /InStock HTTP/1.1 ENVELOPE Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 HTT HEADER Content-Length: 299 SOAPAction: "http://www.w3.org/2003/05/soap-envelope" P <?xml version="1.0"?> <soap:Envelope BODY xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> </soap:Header> <soap:Body> <m:GetStockPrice xmlns:m="http://www.example.org/stock"> FAULT <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
  • 4. Simple Example REQUEST POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
  • 5. Simple Example RESPONSE HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope>
  • 6. SOAP Characteristics, Pros and Cons  Implements its own protocol  Exposes pieces of application logic, operations  Advantages ◦ Versatile in use of different application protocols ◦ Tunnels easily through firewalls due to the use of HTTP model  Disadvantages ◦ Slower when using large XML messages
  • 7. What is REST?  REST: Representational State Transfer focuses on accessing named resources through a consistent interface  Every resource has its representation (could be a document) and the resource state changes when some method is applied through a request using any vocabulary
  • 8. Constraints and Principles  Client-server  Cacheable  Stateless  Uniform interface  Identification of resources  Manipulation of resources  Self-descriptive messages
  • 9. SOAP vs. REST  SOAP RPC: Application designers have to build up their protocol vocabulary whereas in REST it uses the well known vocabulary of the protocol in use  REST: Different data formats where SOAP only allows XML  REST has support for JSON, uses standard HTTP  REST better performance and scalability  SOAP reads cannot be cached
  • 10. When to wash? When to relax?  SOAP ◦ WS-Security: enterprise security features ◦ WS-AtomicTransactions: ACID compliant ◦ WS-ReliableMessaging: end-to-end reliability ◦ Ex.: smartphone app that communicates with a bank app on the web, need the previous implementations  REST ◦ Lightweight ◦ Less complex for maintenance ◦ Bring the “web” back to web services
  • 11. Reference  http://www.w3schools.com/soap/default.asp  http://en.wikipedia.org/wiki/Representational_State _Transfer  http://en.wikipedia.org/wiki/SOAP  http://www.crummy.com/writing/RESTful-Web- Services/  http://tomayko.com/writings/rest-to-my-wife