简体   繁体   中英

ASP.NET 3.5 Webservices

I am about to start my first web service in ASP.NET. when searching in google it shows

RestFul Service

SOAP services

WCF 

Which one is stable?.What is the key differece among them?

Define "stable" ;-p

If you mean "time in the field", then for .NET the order would be SOAP (asmx), WCF, REST

Note that there is a big shift between the data-centric REST services (typical of ADO.NET Data Services) and WCF / asmx, which are operation-centric.

REST is perhaps more flexible for the caller; WCF / asmx has more rigid control (in terms of exposing discreet operations). Both have their places, but I tend to still make my default the operation-centric approach (via WCF) in most cases (a defined number of things to test, etc).

WCF is a bit more evolved than the original web-services offered in .NET, and has better WSE support (although asmx can be extended via WSE3). If you are starting today, WCF would be a better choice than asmx in most cases.

Definitely go with WCF - it's the current and future technology for cross-machine communication.

The question of SOAP vs. REST is a bit like manual vs. automatic transmission - it depends on your needs and preferences.

SOAP is in general a bit more sturdy - it has things like WSDL and XSD - schema and metadata to clearly and definitely describe a service and all its methods and all its data being passed around. Highly useful in enterprise environments.

REST on the other hand is the much more approachable, easy to understand, just-point-your-code-at-a-URL-and-get-XML-back approach. Works well, it's almost human-readable, less overhead, but also less "security" - since there's really hardly any metadata describing the service - either you know it yourself since you're the author of the service, or the service provider has a good documentation somewhere.

So there's no clear winner in my opinion - pick the one closer to your needs and your preferences.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM