There are several situations that will require WCF. First, it should be noted that “require” is a strong word, while WCF is the current preferred communication model in .NET, the platform has a history of other methods that are still supported.
Case Study 1 : Your web application does not work well, because part of the computational work of preparing the answer is “computationally expensive” and is powered by a processor. You want to move part of the expense to a service that works in a different field, where you can allocate isolated resources. You create a WCF service that wraps functionality and deploys this service in a different field, using a proxy class to access it over the network.
Concrete Example 2 : Your Windows application needs to access resources that are behind a firewall that your users cannot penetrate. So instead, you choose to deploy the service in the DMZ, which the application can use, and which of the DMZ accesses limited material and returns the results to your application.
WCF is a powerful tool and does incredible things to help service development, especially when you are developing SOAP-based services. On the other hand, many people think that currently an easier way to write RESTful services is to do this using ASP.NET MVC WebAPI. WebAPI began as a project of the WCF team, but was eventually transferred to MVC for various reasons. If you are interested in REST, I would recommend looking at the WebAPI.
source share