Difference between SOAP vs REST WebService
1) SOAP is a XML based message protocol while REST is an architectural style protocol.
2) SOAP uses WSDL for communication between consumer and provider, while REST uses XML or JSON to send and received data.
3) SOAP invokes services by calling RPC method while REST simply calls services using HTTP methods via URL Path.
4) SOAP Web services does not return human readable result but REST result is readable because it's just plain XML or JSON.
5) SOAP transfer is over HTTP, but it can also use other protocols such as SMTP, FTP etc, but REST can only use HTTP as transport protocol.
6) Even though you can use SOAP with JavaScript, it's difficult to implement as compared to REST which is very easy to use with JavaScript.
7) REST has better performance over SOAP because its less CPU intensive and requires less resources.
These were some key difference between REST and SOAP Web Service from Java Interview perspective. If you think I have missed any key difference then feel free to add into this list.
Thank you.
No comments:
Post a Comment