Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use SOAP instead of REST in terms of web services?

Tags:

rest

.net

soap

wcf

Currently I am learning new topics Web services in ASP.NET but I am not understanding the concepts of SOAP and RESTful in web services and how to create these type of services in .NET.

like image 220
Mukesh Kumar Avatar asked Jan 03 '14 08:01

Mukesh Kumar


1 Answers

One of the major benefits of SOAP is that you have a WSDL service description. You can pretty much discover the service automatically and generate a useable client proxy from that service description (generate the service calls, the necessary data types for the methods and so forth). Note that with version 2.0, WSDL supports all HTTP verbs and can be used to document RESTful services as well, but there is a less verbose alternative in WADL (Web Application Description Language) for that purpose.

With RESTful services, message security is provided by the transport protocol (HTTPS), and is point-to-point only. It doesn’t have a standard messaging system and expects clients to deal with communication failures by retrying. SOAP has successful/retry logic built in and provides end-to-end reliability even through SOAP intermediaries.

One of the major benefits of RESTful API is that it is flexible for data representation, for example you could serialize your data in either XML or JSON format. RESTful APIs are cleaner or easier to understand because they add an element of using standardised URIs and gives importance to HTTP verb used (i.e. GET, POST, PUT and DELETE).

RESTful services are also lightweight, that is they don’t have a lot of extra xml markup. To invoke RESTful API all you need is a browser or HTTP stack and pretty much every device or machine connected to a network has that.

Finally, which ever architecture you choose make sure its easy for developers to access it, and well documented.

REF:http://blog.manishchhabra.com/2013/04/rest-and-soap-web-services-analogy/

like image 51
StackTrace Avatar answered Nov 16 '22 03:11

StackTrace