Brief comparision:Soap VS Rest

目录

一、Soap

二、Rest

三、Soap VS Rest

Reference:


一、Soap

Soap (Simple Object Access Protocol) is a messaging protocol specification for exchanging structured information in the implementation of  web services in the computer networks.

Therefore, (as soap is a protocol) it imposes some build-in rules that can add complexity and overhead, and also lead to long page load times. 

The advantage of soap is safety. It supports not only SSL protocol (Secure Sockets Layer)(端到端加密), but also WS-Security protocol (WS = web services) which adds some enterprise security features.

In addition, it build-in the ACID characteristic of database to ensure the consistency and reliability of transactions. This is the reason why banks and payment system use soap. 

二、Rest

Rest (Representational state transfer) is a set of web API architecture principles (or style) which suitable for lightweight web services and mobile applications. 

The advantage of rest api is more flexible and easy to use.

三、Soap VS Rest

SoapRest
ConceptMessaging protocol specification.

Web api architecture principles

(style).

Concept

Make data available as services(operation).

Eg: GetUserInfo.

Make data available as resources.

Eg: UserInfo.

ServicesBack-end services.Front-end services

Returned

messages

type

XML onlyXM, HTML, JSON, PDF, Text, etc.

Communi-

cation methos

HTTP, TCP, Web Sockets, etc.HTTP only.

Message

patterns

Request-reply, one-way.Request-reply only.
Cons

1. Soap consume more bandwidth.

2. Take much effort to implement and is not good for integrate between Web and mobile developers.

1. Less security.

2. Based on Http protocol only.

SecuritySupports both SSL security and WS-security, which adds some enterprise security features.Support only point-to-point SSL security.
CacheNot support data caches.Support data caches.

 


Reference:

【大厂面试】面试官:你连RESTful都不知道我怎么敢要你?

SOAP 和 REST 区别解析

SOAP和REST的基本区别

REST vs SOAP, the difference between soap and rest

老说的API到底是什么??

『教程』什么是API函数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

m1m-FG

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值