Why isn't SOAP-based web service RESTful?

后端 未结 7 1377
无人及你
无人及你 2021-01-29 20:54

I understand RESTful is an architecture style, but what exactly makes SOAP-based web service not count for RESTful?

It\'s not clear to me which points below (from Wikipe

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-29 21:32

    REST and SOAP are not equivalent concepts.

    REST:

    • Depends on one transport protocol (HTTP).
    • Makes full use of the specific features of that protocol (verbs GET, POST, PUT, DELETE, caching, headers, and predefined error codes).
    • Says nothing about the format of the messages passed back and forth. However, since the HTTP verb and URL already define the action to take, the message body must therefore contain only the data.
    • Message security is provided by the transport protocol (HTTPS), and is point-to-point only. If you want to secure the message end-to-end, you have to do it yourself.
    • Originally intended for simple CRUD operations on objects.

    SOAP:

    • Independent of the transport protocol (could be HTTP, FTP, TCP, UDP, named pipes, shared memory or even email).
    • Requires only that the transport protocol be able to send and receive text (e.g. on HTTP, only the POST verb is used).
    • Strictly defines the format of the messages passed back and forth. A SOAP message contains the data, the action to perform on it, the headers, and the error details in case of failure.
    • Message security is provided by the WS-* standards, and is end-to-end.
    • Originally intended for arbitrary RPC calls.

    Items 2 and 3 in the above lists are the main points of incompatibility.

提交回复
热议问题