Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rest vs Wcf pros and cons [closed]

Tags:

rest

wcf

What are the pros and cons of using a rest service vs a wcf service?

I am wondering which type to use and I was interested to find some sort of comparision.

like image 620
zachary Avatar asked Apr 27 '12 21:04

zachary


People also ask

Should I still use WCF?

Remember WCF is already a legacy technology. Microsoft has stopped developing it, it lacks the features of a . NET Core technology, and it is possible that WCF is not the best framework for the job anymore.

When should we use WCF instead of RESTful API?

WCF is a best fit for scenarios like message queues, duplex communication, end-to-end message security, one way messaging, distributed transactions, etc. WEB API is a best fit to create a resource-oriented services using HTTP/Restful and it works well with MVC-based applications.

What is replacing WCF?

The Windows Communication Foundation (WCF) is a communication platform for the creation of distributed applications developed by Microsoft for the . NET Framework. Microsoft generally recommends two alternatives, gRPC and Web API, to replace WCF.

What is the difference between WCF and REST service?

WCF is used for developing SOAP-based services whereas Web API is used for both SOAP-based and RESTful services. WCF does not offer any support for MVC features whereas Web API supports MVC features. WCF supports HTTP, UDP, and custom transport protocol whereas Web API supports only HTTP protocol.


2 Answers

Rest is a way of doing communication over the internet. It is a very basic process of picking addresses to serve as method locations and returning HTML standard data (javascript, css, html of course).

WCF is a .net library used to have two programs talk to each other using SOAP. Which consists of two very familiar programs trading class info.

Seeing as Rest is a process, and WCF is a class library, a better question might be "Rest vs Soap".

The bottom line is, if you need two apps to talk, you might want to use WCF. Even if the apps are not both written in .net. However if you need information to be accessed by web tech(usualy javascript access is done this way) you'll want to use Rest.

Just a quick side note though, WCF does Rest well too, so you realy can't go wrong there.

like image 192
R Esmond Avatar answered Sep 28 '22 11:09

R Esmond


You're asking a question about apples and oranges. REST is pattern used in creating web services. I'm not an expert on it, but you can find plenty of details on Wikipedia. WCF is a Microsoft technology for creating web services (primarily using SOAP, although it's so configurable that you can do REST on it as well - see ASP.Net WebAPI).

Pros for WCF:

  1. Very configurable - If you can imagine it, WCF can probably do it.
  2. Simple to use if you're sticking to the Microsoft stack. Visual Studio does 90% of the work for you.

Cons for WCF:

  1. Very configurable - It can be a bit of a pain to get it do exactly what you want sometimes, especially if you're new to it.
  2. There can be some problems communicating between different technology stacks. I've heard of Java services curling up and dying when pointed at a WCF service. As far as I've heard, this is a problem with the Java libraries, not WCF, but who knows for sure.

That's all that comes to mind right now, but hopefully that gives a you a decent impression on WCF.

like image 21
Eric Andres Avatar answered Sep 28 '22 11:09

Eric Andres