Java 中 SOAP 和 RESTful Web 服务之间的主要区别 [英] Main differences between SOAP and RESTful web services in Java

查看:30
本文介绍了Java 中 SOAP 和 RESTful Web 服务之间的主要区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我对 SOAP 和 RESTful 服务之间的区别有了一些了解.

For now I have a slight idea about the differences between SOAP and RESTful services.

我的问题是什么时候应该使用 SOAP,什么时候应该使用 RESTful;在性能/速度或请求处理方面,哪一个更好"?

My question is when I should use SOAP, and when I should use RESTful; which one is "better" when it comes to performance/speed or request handling?

我是第一次在 RESTful (Java) 中实现它,我想了解更多;我以前处理过 SOAP.

I'm implementing it for the first time in RESTful (Java) and I want know more about it; I've dealt with SOAP before.

这是这篇文章的后续问题.

推荐答案

REST 几乎总是会更快.SOAP 的主要优点是它为服务提供了一种机制来向客户端描述它们自己,并通告它们的存在.

REST is almost always going to be faster. The main advantage of SOAP is that it provides a mechanism for services to describe themselves to clients, and to advertise their existence.

REST 轻得多,几乎可以使用任何工具实现,从而降低带宽和缩短学习曲线.但是,客户必须知道要发送什么以及期望什么.

REST is much more lightweight and can be implemented using almost any tool, leading to lower bandwidth and shorter learning curve. However, the clients have to know what to send and what to expect.

一般来说,当您向外部世界发布复杂或可能更改的 API 时,SOAP 会更有用.除此之外,REST 通常是更好的选择.

In general, When you're publishing an API to the outside world that is either complex or likely to change, SOAP will be more useful. Other than that, REST is usually the better option.

这篇关于Java 中 SOAP 和 RESTful Web 服务之间的主要区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆