REST vs SOAP

Last modified on October 15th, 2014 by Joe.

This article is to compare REST vs SOAP. There is huge difference between REST and SOAP. Comparing SOAP and REST is not just right as they are different things. It is like comparing orangutan and octopus, I have high regard for both of them. But still, as it is a popular topic lets have a discussion on SOAP vs REST.

Roy Fielding was a member of the team that wrote the specification for HTTP and co-founder of Apache HTTP server project. He introduced the word REST and the concept in his doctoral thesis in 2000. REST disruptively took over as an architectural style for web services implementation.

Comments on "REST vs SOAP"

  1. Matt Kleidemran says:

    This of course, begs the question: “Which is the octopus, which is the orangutan, and why?”

  2. Mario Guerrero says:

    Rest win !!!

  3. Vijay says:

    good summary. can you please give a simple example where each one is preferred or appropriate?

  4. Shaan says:

    I think rest is today world of WS.

  5. MD SHAUKAT ALI says:

    Although it is always said that REST dominant over SOAP but as i think REST is only suitable to small or mid size application as far as the enterprise level development specially in vertical industry like banking etc is concerned SOAP is preferably used due to its security and governance implementation …am i right joe sir?

  6. Joe says:

    :-) its my attempt at humour and long way to go. So happy to see you comment Matt. Thank you.

    I remember instances when you tried hard to impart RESTful philosophy to us and many discussions on uniform URL, atomicity and status codes.

  7. Joe says:

    My personal preference is to always go with RESTful services unless otherwise there is a specific mandate that requires SOAP based services.

    In restricted security scenarios where we need something more than transport security then we can think about SOAP.

  8. Joe says:

    The web based banking transactions we do rely only on the HTTPS. End user authenticates over HTTPS, once authenticated every action done by that user is legitimate. Web based banking transactions work based on this principles.

    If the above is fine, then RESTful services can be used for banking transactions too. SOAP has well defined, detailed WS-Security specification.

    In REST we just use HTTPS to secure our messages over network. In SOAP using WS-Security spec, we can use message encryption, signature and all these over HTTPS. If we feel transport security alone is not sufficient, we can go with SOAP and WS-Security. It is all left to the requirement and chance we can take.

  9. Rajesh says:

    SOAP has the advantage over RESTful services in message level security.

  10. Asraful Forhad Chowdhury says:

    i think , octopus and orangutan used as a term and reference to make readers clear how to compare this two things SOAP vs REST, recently i write a REST service using jersey framework and face difficulty to design URL for different service , expecting more on REST from Joe. Thanks a lot for such a good site.

  11. Rahul S says:

    Rest-ful APIs can be consumed using simple GET requests, intermediate proxy servers / reverse-proxies can cache their response very easily. On the other hand, SOAP requests use POST and require a complex XML request to be created which makes response-caching difficult

  12. akash says:

    then the question aries how you will compensate WS-security, session, WS_transactions etc with REST?

  13. Yogesh Nerkar says:

    Hi Joe,

    This is nice info about SOAP and REST. It would be nice if you have code based examples as well.

    Yogesh

  14. Joe says:

    https://javapapers.com/web-service/soap-web-service-introduction/ – refer this for a SOAP hello world service.

    Soon I will write example code for REST web services too.

  15. Kannan Subbiah says:

    Nice attempt to compare REST and SOAP. Yes, it is like comparing Oranges with Apples. I am sharing this through my

  16. karthikeyan says:

    Dear Joe,
    It was very good attempt. but, it seems like summary. As yogesh said, it would be more powerful if there is code based examples. I am waiting for that.

  17. Friend of Joe says:

    Hi Joe,

    A tip for you : You have a habit of saying ” does not has” like for example “But SOAP doesn’t has any such requirements”

    The correct grammar is “it does not have”. Lot of desis do that mistake.

    “But SOAP doesn’t have any such requirements”

  18. mani says:

    which is the best one to implement in online shopping website development

  19. Mauro Dutra says:

    The intelligent, resourceful and complex octopus is SOAP. And, the colorful, inventive, free spirited orangutan is REST.

  20. Joe says:

    Wow! I really like this :-)

  21. Karthik says:

    Hi Joe,

    Am new to this webservices. The above differences you mentioned sounds good. I have one basic query, what is the difference between Rest vs Restful. In some places you have mentioned Rest and Restful in some other places. Both are same ? or different. If its different, can you tell me where both stands and what is the difference ?

    Thanks,
    Karthik.

  22. Joe says:

    REST is the acronym for the concept (just the name). When we say RESTful, it is adhering to REST’s philosophy.

    RESTful services means, services that follows the REST philosophy(rules/concepts).

  23. Mahesh says:

    hi Joe please call me
    if you are staying in Bangalore.
    9740324405

  24. Bill says:

    Actually, I think most people would agree that the orangutan is the more intelligent of the two. However, the octopus is probably the smartest invertebrate creature living today.

  25. Sridhar says:

    Hi Joe,

    As you said,Even SOAP based web services can be implemented in RESTful style.Does the SOAP services supports http methods other than post.

  26. Anders says:

    If you only uses GET, you are not using REST. In REST, you use POST when you update the state (database) on the server.
    Never use GET to update state, as it is supposed to be omnipotent.

  27. Anders says:

    REST only works over HTTP and HTTPS. WS/SOAP works over HTTP, HTTPS, SMTP, XMPP, etc etc.
    So you can send SOAP requests through email, securely, if you want.
    SOAP support transactions too.

    So there are more difference than stated in this article.

    Yes, most SAOP frameworks can produce RESTful interfaces too. So you get both world there.

  28. dkm says:

    REST works on HTTP channel, while SOAP works on HTTP, FTP, SMTP channels.

    Rest requires no client side library written in WSDL like SOAP.

  29. dev07 says:

    thats correct. we require third party libraries for soap. ex. in android, we require KSOAP2 Library. but for REST, we dont require anything like this.

  30. Saurabh says:

    Not sure if it was intentional or not, but I think the key missing thing is do explain in brief what is SOAP and what is REST. That is what I was looking for. So I will go to wikipedia. The information was very useful. Thanks.

  31. Arun says:

    Idempotent?

  32. sridhar says:

    Can any one answer my question plz.

  33. rahul says:

    sir,
    i would like to know more about REST can u please provide more information on it i had google out but still unclear with concept also is REST and ROA are same n what is SOAP vs SOA

  34. Vijay says:

    I want to take a seminar In REST topic in my college, So can u plz give some like.

  35. Francis says:

    It should be… lot of desis make that mistake.

  36. Sridhar.Goranti says:

    Hi Joe,

    This is nice info about SOAP and REST with nice content. It would be nice if you have code based examples as well.

    Expecting more examples soon Joe.

    Thanks, Sridhar Goranti

  37. Alaa Agha Karss says:

    Thanks for your efforts and the useful information.

    still want to know more of the concepts about both ,I am a beginner and I would like to understand them both and then to read the comparison again.

  38. ps says:

    am working on bigdata, so which one is more usefull?

    and whether the soap without wsdl act as rest?

  39. raghav says:

    Your website content is very simple and straight forward. Please be aware of few grammatical mistakes. I don’t think “doesn’t has” is correct it should be like “doesn’t have”

  40. Amay says:

    Really nice post … But which one is good at scalability?

  41. Ashok says:

    Very nice summary, very very useful. Thanks Joe.

  42. Shoebuddin says:

    Awesome differences Thanks.

  43. siva says:

    good stuff

  44. Gowtham says:

    Hi Joe,

    i am planning to create a mobile application.having a few clarifications whether i could use SOAP for this?? could you help me out your suggestions for this ?? and also let me know what could be suitable either REST/SOAP if it comes for mobile apps.

  45. Tarik Makhija says:

    Hi Joe , I am a big fan of your website , I have been following your website for past 3-4 years. I like your blogs because of the simplicity and ease of understanding. I have one question for you , Using a RestFul Webservice , How can we invoke or call SOAP Based webService ?

  46. […] tutorial we will see about how to Tweet / post using Java via Twitter API. Twitter provides a rich REST API to create Twitter enabled applications. It provides the complete possibilities, right from reading […]

  47. Ahmed Drira says:

    on the corp of your restful WS you have to write a SOAP Client , So by invoking the REST WS , the responsible method will invoke the SOAP client too and their you SOAP WS will be invoked by the rest WS , The SOA architecture is something like this

  48. sysadmin says:

    Very useful info. Thanks joe

  49. sskcar says:

    Your initial description compare “apples to apples” this is over exaggerated.
    Both are same…you did not describe much about what is different in terms of the purposes, covered only the implementation and technical’s.

    But good try by consolidating all technical/implementation differences.

  50. Amine says:

    nice comparison (Y)

  51. Bijoy says:

    Nice introduction to web services .. Thanks

  52. Rajesh says:

    Joe, The article is good. Can you please suggest a common framework to use REST as well SOAP based webservice. I can think of Apache CXF. But i need your suggestion. Thanks.

  53. Lakshmi says:

    Hi, Can you please tell me few similarities between SOAP and REST. Thanks

  54. noname says:

    Is SOAP outdated?. Why should we use REST instead of SOAP?… What do you think is the best?. Which is most widely used? What percentage of companies are really using SOAP? IS one alternative to another?.If i learn both ,wont I get confused?. Is it mandatory to learn both ? Isn’t it enough to learn either SOAP or REST?..

  55. Joe says:

    No! SOAP and REST should be used as the situation demands. It depends on the use cases you are applying. Its better you learn both.

  56. Abhijit says:

    CAn any one please explaing what does it means by ‘REST follows stateless model’?
    Also are SOAP and WSDL one and the same?

  57. parth says:

    Thanks for explaining in simple words,it’s easy to understand the differences.
    I have searched various article but they were heavy to digest,,,
    Thanks for posting wonderful info,,,:)

Comments are closed for "REST vs SOAP".