Why prefer REST over SOAP?

后端 未结 4 824
终归单人心
终归单人心 2021-02-14 04:15

If I need a web service to pass back and forth a complex object, is there a reason I should prefer SOAP over REST? Here is an example of the possible SOAP message:



        
4条回答
  •  滥情空心
    2021-02-14 05:07

    Your first requirement of "passing back and forth a complex object" constrains your architecture to eliminate many of the benefits of REST. SOAP is designed for accessing remote objects, REST is not. REST supports passing media-types as simple as text/plain, which is far more primitive than dealing with an object.

    If you haven't seen it already, this question and its answers cover most of the REST vs SOAP issues.

提交回复
热议问题