zoukankan      html  css  js  c++  java
  • SOAP vs REST

    Both methods are used by many of the large players. It's a matter of preference. My preference is REST because it's simpler to use and understand.

    SOAP:

    • SOAP builds an XML protocol on top of HTTP or sometimes TCP/IP.
    • SOAP describes functions, and types of data.
    • SOAP is a successor of XML-RPC and is very similar, but describes a standard way to communicate.
    • Several programming languages have native support for SOAP, you typically feed it a web service URL and you can call its web service functions without the need of specific code.
    • Binary data that is sent must be encoded first into a format such as base64 encoded.
    • Has several protocols and technologies relating to it: WSDL, XSDs, SOAP, WS-Addressing

    Representational state transfer (REST):

    • REST need not be over HTTP but most of my points below will have an HTTP bias.
    • REST is very lightweight, it says wait a minute, we don't need all of this complexity that SOAP created.
    • Typically uses normal HTTP methods instead of a big XML format describing everything. For example to obtain a resource you use HTTP GET, to put a resource on the server you use HTTP PUT. To delete a resource on the server you use HTTP DELETE.
    • REST is a very simple in that it uses HTTP GET, POST and PUT methods to update resources on the server.
    • REST typically is best used with Resource Oriented Architecture (ROA). In this mode of thinking everything is a resource, and you would operate on these resources.
    • As long as your programming language has an HTTP library, and most do, you can consume a REST HTTP protocol very easily.
    • Binary data or binary resources can simply be delivered upon their request.
  • 相关阅读:
    JS基础_函数的简介
    frp 使用入门
    树莓派开启smb
    python 反射调用
    VIDEOIO ERROR: V4L: can't open camera by index 0 for raspberryPi
    face_recognition 人脸识别报错
    安装FFMpeg CentOS 7
    Centos 7 smb 安装使用
    ImportError: libQtTest.so.4: cannot open shared
    Raspberry Pi 3b+ 配置摄像头
  • 原文地址:https://www.cnblogs.com/reynold-lei/p/3724688.html
Copyright © 2011-2022 走看看