none
Technology decision between WCF and ASP.NET RRS feed

  • Question

  • Hi

    I'm currently in the process of designing a large softwarecomponent (Client + Server) and am currently a bit unsure which Technology would be the better to use.

    I'm currently trying to decide between WCF and ASP.NET there. As far as I know both would be suited and could perform fast enough, but I'm unsure in regards to which would have more Advantages in such a Situation and which one more disadvantages (thus what the adv/disadv would be there in this case).

    I hope someone here could help me there a bit with the decision.

    The Situation is as follows:

    -I've got 600 Clients who try to contact the Server every few seconds to 15 minutes (depending on the load on the Clients)

    -The Clients either send text data to the Server (logs) or execute functions there

    -The Server either sends text data to the Clients or Downloads files to them (up to 500 MB).

    -All data Transfer is encrypted (example SSL for ASP.NET).

    As said I'm unsured there if ASP.NET or WCF would be better suited there, or if both would be equally suited?

    Monday, November 27, 2017 10:55 AM

All replies

  • You have four choices ASP.NET legacy ASMX service, ASP.NET WCF Web service. ASP.NET WebAPI service and WCF Restful Web service, with all of them being able to use HTTPS.

    https://existek.com/blog/wcf-vs-web-api/

    https://www.codeproject.com/Articles/341414/WCF-or-ASP-NET-Web-APIs-My-two-cents-on-the-subjec

    http://www.dotnettricks.com/learn/webapi/difference-between-wcf-and-web-api-and-wcf-rest-and-web-service

    You can also post to the ASP.NET forums.

    http://forums.asp.net/

    Monday, November 27, 2017 12:40 PM
  • Please post this question in the ASP.NET forums. They are going to be able to better direct your question. But for server to server calls you're going to want to use Web API (otherwise known as REST in most circles). There is no reason to use WCF these days. It is too limiting. Everyone uses web API.

    Michael Taylor http://www.michaeltaylorp3.net

    Monday, November 27, 2017 3:03 PM
  • Please post this question in the ASP.NET forums. They are going to be able to better direct your question. But for server to server calls you're going to want to use Web API (otherwise known as REST in most circles). There is no reason to use WCF these days. It is too limiting. Everyone uses web API.

    Michael Taylor http://www.michaeltaylorp3.net


    That's not true at all that everyone is using WebAPI. WCF is still used. I have seen shops still using WCF with one shop using ASP.NET WCF Web services using the Repository pattern sitting behind WebAPI services within the infrastructure of a n-tier MVC solution.  
    Monday, November 27, 2017 10:06 PM
  • Take a look at all the new services coming out. No one is using WCF anymore. It is too tightly coupled to legacy web service standards and Windows (ever tried to call a WCF service via SoapUI, it is a nightmare). REST APIs can be used by any language that understands HTTP, is more flexible, already described by well-defined standards and is faster. Every major service provider including Microsoft, Google and Amazon are putting their effort into REST. It is the future.

    WCF (like web services) will be around for a while as not everything can be/has been migrated but I'm not aware of any major services being implemented in WCF or SOAP going forward. The closest WCF equivalent is JSON-RPC. They are outdated. It would be unwise to put your money in WCF when you can more quickly target REST using .NET or .NET Core or Java or any other language.


    Michael Taylor http://www.michaeltaylorp3.net

    Monday, November 27, 2017 10:17 PM
  • Btw, why not both? :P

    Since the asker mentioned they need to allow download large files too, implement download related function in ASP.NET would be far more efficient then have to encode binary data to text and encapsulate in envelope. It's not like they cannot exists on the same server.


    • Edited by cheong00 Tuesday, November 28, 2017 2:20 AM
    Tuesday, November 28, 2017 2:20 AM
  • @Mike,

    Don't kid yourself into thinking that WCF is not going to be used in new development. :)

    http://www.ben-morris.com/comparing-web-api-2-and-wcf-for-building-services-for-http-and-rest/

    <copied>

    Since the WCF and ASP.NET teams have merged much of the fragmentation that lingered around Microsoft’s HTTP service stack has been resolved. They appear to have settled on a strategy where they direct you towards WCF to create web services that accessible over a variety of transports and ASP.NET Web API to create REST-style services

    <end>

    Backend infrastructures are not centered around a  backend WebAPI sitting on the backend application server, like WCF is doing with ASP.NET Web services sitting on the backend.

    WebAPI is there over HTTP to accommodate the browsers, mobile, JavaScript, Ajax and things happening on the client-side.  

    And besides, one shop had frontend Web servers using WCF over TCP/IP using binary communications to WCF services to the backend application server. WebAPI can't match it on the speed.

    WebAPI is just MVC as far as I am concerned. As a matter of fact, you can take a WebAPI project and turn it into a MVC solution. :)

      

    Tuesday, November 28, 2017 3:26 AM
  • Sorry DA924x but I completely disagree with you. The article you linked to is 3 years old and mostly outdated now. Unless you plan to work with only Windows then WCF isn't the solution. I've written many WCF services over the years and quite a few REST APIs. Without question the WCF services are harder to implement and test, they don't work well outside of .NET clients and they don't scale in a modern, cloud-based world.

    REST is simple, works with any HTTP client and can be easily converted to a micro-service hosted in Azure or AWS or containerized and put into Docker or Windows Server. Clients simply don't care. WCF requires correct configuration on both ends because it is more flexible but if you never need that kind of flexibility then the overhead is not worth it. The SOAP implementation it uses doesn't work properly with some SOAP clients (i.e. Ruby) and doesn't provide any advantages over HTTP. The only use case for WCF now, as you linked in your post, is if you need to support multiple transports but that doesn't occur very often in the world in my experience. REST just works and doesn't require anything more than JSON which everything supports now. JSON is faster to load than XML as well (although you can do REST with any format, JSON is the defacto).

    Backend infrastructure is implemented in REST now. Look at Office, VSTS, AWS - they are all REST-based. Web API is not for client side logic. Never has been. All the samples may indicate client side logic (and that is one use case) but that is very limiting if you go that approach. The throughput of REST is incredible compared to WCF. We have converted a portion of our WCF services (internal and external) over to REST and our scalability is better, they can be clouded as needed and our clients are very happy with being able to use the HTTP client of their platform. No more discussions of SOAP, WS-A, buffer sizes, etc.

    Web API is not MVC, never has been. Even if it were then that wouldn't be a bad thing. The pipelines are completely different (unless you're using .NET Core). In a pure REST API, you'd not even include MVC as there is no reason to. The only time you would combine MVC and web API is in a web app. This isn't a REST API though. I think you're confusing web APIs and REST. They are different even if they use the same base infrastructure to implement in .NET.

    The OP asked for suggestions. I stand by mine that REST is the answer to server-to-server communication. While there may be a case for WCF somewhere I cannot think of any scenario where I would recommend it at this point.


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, November 28, 2017 5:27 AM
  • Hi Thomas,

    In fact, I am not too sure which technology is more powerful, but I can provide some information on these two technologies, you can refer to it to choose the more suitable one:

    The following table describes the major features of each technology:

    WCF ASP.NET Web API
    Enables building services that support multiple transport protocols (HTTP, TCP, UDP, and custom transports) and allows switching between them. HTTP only. First-class programming model for HTTP. More suitable for access from various browsers, mobile devices etc enabling wide reach.
    Enables building services that support multiple encodings (Text, MTOM, and Binary) of the same message type and allows switching between them. Enables building Web APIs that support wide variety of media types including XML, JSON etc.
    Supports building services with WS-* standards like Reliable Messaging, Transactions, Message Security. Uses basic protocol and formats such as HTTP, WebSockets, SSL, JQuery, JSON, and XML. There is no support for higher level protocols such as Reliable Messaging or Transactions.
    Supports Request-Reply, One Way, and Duplex message exchange patterns. HTTP is request/response but additional patterns can be supported through SignalR and WebSockets integration.
    WCF SOAP services can be described in WSDL allowing automated tools to generate client proxies even for services with complex schemas. There is a variety of ways to describe a Web API ranging from auto-generated HTML help page describing snippets to structured metadata for OData integrated APIs.
    Ships with the .NET framework. Ships with .NET framework but is open-source and is also available out-of-band as independent download.

    Refer: WCF and ASP.NET Web API.

    Also please refer to these documents:

    What's the Difference between WCF and Web Services?

    Comparing ASP.NET Web Services to WCF Based on Development.

    WCF Services and ASP.NET.

    In addition, I suggest you can ask your question at WCF, ASMX and other Web Services Forum.

    Regards,

    Stanly


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 28, 2017 6:02 AM
  • The OP asked for suggestions. I stand by mine that REST is the answer to server-to-server communication. While there may be a case for WCF somewhere I cannot think of any scenario where I would recommend it at this point.

    I have seen the implementation of ASP.NET WCF Web services sitting behind Web API services implemented in a ASP.NET MVC N-tier solution sold to jurisdictions across the US and Canada, which also provided services through WebAPI services to those clients that was developed by a very competent architect . So I  will agree to disagree with you that WCF Web services are going away.

    I'll agree that WebAPI is the simpler of the two solutions, but WCF has life in the backend infrastructure behind n-tier boundaries  on the application server in enterprise level solutions.  

    Web API is not MVC, never has been. Even if it were then that wouldn't be a bad thing.

    If its a bad thing or not, I seen the code and seen it in action.

    Tuesday, November 28, 2017 7:53 AM