Logo

dev-resources.site

for different kinds of informations.

REST VS SOAP

Published at
11/29/2024
Categories
soap
api
rest
json
Author
fernilo
Categories
4 categories in total
soap
open
api
open
rest
open
json
open
Author
7 person written this
fernilo
open
REST VS SOAP

Cuando se envía una solicitud de datos a una API de REST, se suele hacer a través de un protocolo de transferencia de hipertexto, denominado HTTP. Una vez que reciben la solicitud, las API diseñadas para REST (conocidas como API o servicios web de RESTful) pueden devolver mensajes en distintos formatos: HTML, XML, texto sin formato y JSON. Opera principalmente mediante verbos HTTP (GET, POST, PUT, DELETE).

REST es Menos robusto para transacciones complejas o seguridad avanzada pero es más rápido y ligero (JSON es menos pesado que XML).

Escenarios comunes: Aplicaciones web y móviles, API públicas.

Image description
(Fuente: Seobility)

SOAP (Simple Object Access Protocol) es un protocolo de comunicación basado en XML que permite la interacción entre sistemas a través de redes. Como es un protocolo, impone reglas integradas que aumentan la complejidad y la sobrecarga, lo cual puede retrasar el tiempo que tardan las páginas en cargarse

Por su seguridad y por la integridad de los datos, SOAP es más recomendable.

Escenarios comunes: Servicios empresariales, integraciones complejas.

Ejemplos

REST(json)
GET /api/users/123 HTTP/1.1
Host: example.com

Response:
{
    "id": 123,
    "name": "John Doe"
}
Enter fullscreen mode Exit fullscreen mode
SOAP(xml)
POST /soap HTTP/1.1
Host: example.com
Content-Type: text/xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetUser>
            <UserId>123</UserId>
        </GetUser>
    </soap:Body>
</soap:Envelope>

Response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetUserResponse>
            <User>
                <Id>123</Id>
                <Name>John Doe</Name>
            </User>
        </GetUserResponse>
    </soap:Body>
</soap:Envelope>
Enter fullscreen mode Exit fullscreen mode
rest Article's
30 articles in total
Favicon
Best Practices for Securing REST APIs: Balancing Performance, Usability, and Security
Favicon
Learning REST APIs in JavaScript
Favicon
Validation in Spring REST Framework (SRF)
Favicon
API Design Best Practices in 2025: REST, GraphQL, and gRPC
Favicon
GraphQL vs REST: When to Choose Which for Your Node.js Backend
Favicon
REST VS SOAP
Favicon
Discover the 9 Best Open-Source Alternatives to Postman
Favicon
Building Robust REST Client with Quarkus: A Comprehensive Guide
Favicon
O que é REST API?
Favicon
Building Async APIs in ASP.NET Core - The Right Way
Favicon
Why Clear and Meaningful Status Codes Matter in Your REST API
Favicon
Understanding Request and Response Headers in REST APIs
Favicon
How Scale Changes Everything - The LiveAPI Perspective
Favicon
A Closer Look At API Docs Generated via LiveAPI's AI
Favicon
Quick and Easy: How to Test RESTful APIs in Java
Favicon
Understanding API Architectural Styles: REST, GraphQL, SOAP and More
Favicon
Implementing Pagination, Filtering, and Sorting in REST APIs
Favicon
REST In Peace
Favicon
Understanding HTTP Status Codes
Favicon
Musings Over What Makes LiveAPI Different (from Swagger Et Cetera)
Favicon
Introduction to APIs: Supercharging Your Web Development Journey
Favicon
An Innovative Way to Create REST APIs
Favicon
Best Practices for Developing and Integrating REST APIs into Web Applications
Favicon
Как подружить котиков, слонов и китов: тестирование Spring-приложений с Testcontainers 🐱🐘🐋
Favicon
Implementing Idempotent REST APIs in ASP.NET Core
Favicon
Understanding REST vs. GraphQL: Which One Should You Choose?
Favicon
Problem Details for ASP.NET Core APIs
Favicon
REST vs. GraphQL: Key Differences, Benefits, and Which One to Choose for Your Project
Favicon
REST vs. GraphQL: Choosing the Right API for Your Project
Favicon
Optimizing Your REST Assured Tests: Setting Default Host and Port, GET Requests, and Assertions

Featured ones: