簡體   English   中英

何時使用網絡服務

[英]When to use web services

我對Web服務的概念是陌生的,但是我經歷了很少的討論,並實現了REST服務。 我有幾個問題

  1. 僅在跨平台通信的情況下才使用Web服務嗎?

  2. 什么時候使用SOAP或REST? 我如何做出決定

  3. Web服務的優點是什么

提前致謝

在花費數小時為SOAP和REST之間的選擇煩惱之前,請考慮一些Web服務支持另一個。 除非您打算創建自己的Web服務,否則可能已經為您決定了使用哪種協議。 極少數Web服務(例如Amazon)支持這兩種服務。 您的決策重點通常集中在最能滿足您需求的Web服務上,而不是使用哪種協議。

SOAP絕對是Web服務訪問的重要選擇。 與REST相比,它具有以下優點:

Language, platform, and transport independent (REST requires use of HTTP)
Works well in distributed enterprise environments (REST assumes direct point-to-point communication)
Standardized
Provides significant pre-build extensibility in the form of the WS* standards
Built-in error handling
Automation when used with certain language products

REST在大多數情況下更易於使用,並且更加靈活。 與SOAP相比,它具有以下優點:

No expensive tools require to interact with the Web service
Smaller learning curve
Efficient (SOAP uses XML for all messages, REST can use smaller message formats)
Fast (no extensive processing required)
Closer to other Web technologies in design philosophy

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM