REST 和 SOAP 是敌人吗? [英] Are REST and SOAP enemies?
问题描述
如今,REST 在网络社区中非常流行.所以很想知道这两个问题.
Nowadays, REST is very popular on web community. So that I am curious to know these two questions.
- SOAP 和 REST 是敌人吗?
- 哪个更好,为什么?
推荐答案
他们不是敌人,因为他们的目的不同.REST 适用于轻量级通信,当您需要一个 Web 服务处理来自大量客户端的大量请求,并且您不需要服务器在与每个客户端的通信中保持状态.
They are not enemies, as they are for different purposes. REST is for lightweight communications, when you need a webservice attending a high number of petitions from a high number of clients, and you don´t need the server keep a state in the communication with each client.
另一方面,SOAP 更重要,但包含一些 REST 中不存在的功能,例如保持状态、处理安全性等.
SOAP on the other hand is more heavywieght, but includes some features not present in REST, like keeping a state, handling security, etc.
所以每个人都会根据情况变得更好.
So each one will be better depending on the scenario.
这篇关于REST 和 SOAP 是敌人吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!