官术网_书友最值得收藏!

REST versus SOAP

One old alternative to REST is SOAP. In fact, SOAP was already, used when REST came along as an alternative. A key difference is that SOAP doesn't have some particular convention that tells consumers how to access that. SOAP exposes its services using WSDL. Consider WSDL as a definition of services that SOAP provides. This is how the consumer knows what SOAP based web service provides and how to consume them.

On the other hand, REST emphasizes on "conventions over configurations". If you look at the URL structures and HTTP verbs of RESTful web services as we did earlier, there is a fixed convention. For example, if you are at the client side and want to create a product, if you know what parameters it will take then you can simply create it by sending a POST request to example.com/product and the resource will be created. If you want to list all the products, you can use the same URL with a GET request. If you get product IDs from the List operation, you can simply use them to update or delete a product by using example.com/product/{product_id} using PATCH and PUT or DELETE respectively. It is that simple to know what URL and HTTP method to use to do a type of operation because these are some conventions that RESTful web services follow. So, the one on the client end will just follow those conventions and will not need large documentations for simple tasks.

Other than that, simplicity of statelessness, separation of concerns, and cache-ability are some of the other advantages of RESTful web services that we have already seen in detail.

主站蜘蛛池模板: 新安县| 江油市| 岳池县| 闽清县| 赤壁市| 六枝特区| 霍州市| 巴马| 固安县| 通州区| 清水县| 宜兰市| 宜兰市| 迁西县| 西平县| 新巴尔虎右旗| 商南县| 正定县| 塔城市| 临潭县| 抚宁县| 谢通门县| 黎平县| 登封市| 齐齐哈尔市| 海原县| 敦煌市| 博白县| 龙海市| 昌黎县| 双桥区| 淳安县| 和静县| 扬中市| 九寨沟县| 汶上县| 北票市| 嘉鱼县| 大厂| 嘉兴市| 洮南市|