WCF vs ASP .Net Web API

前端 未结 4 1233
遥遥无期
遥遥无期 2020-12-07 11:04

What are the pros and cons of using each technology?

WCF Web Api is now merged into Asp.net Asp.net web api now supports self hosting.

I still imagine if I w

相关标签:
4条回答
  • 2020-12-07 11:22

    First, I suggest you read my post on the subject: http://blogs.microsoft.co.il/blogs/idof/archive/2012/03/05/wcf-or-asp-net-web-apis-my-two-cents-on-the-subject.aspx

    Regarding your WSDL question - since the WebApi does not use SOAP, it does not require a WSDL, and does not export one. You can use Hypermedia to return resources with a list of possible activity URLs (think of it as a self-describing resource)

    0 讨论(0)
  • 2020-12-07 11:26

    The choice depends on what we want to do.

    1. ASP.NET Web API is a framework for building non-SOAP based services over HTTP only - so there aren't more transport protocols available using this framework.
    2. WCF / Windows Communication Foundation is a framework for exchanging SOAP-based messages - here we use a lot of transport protocols: HTTP, TCP, Named pipes, MSMQ, etc...

    I am not sure about which one has better performance regarding the amount of data, maybe WCF since we can use low protocols. Any comments are appreciated.

    0 讨论(0)
  • 2020-12-07 11:27

    Use WCF for intranet/B2B sites n Web API for B2C/C2C/internet sites...SOAP/XML is still the standard for intra-businesses communication n it's not going to go away!!!

    0 讨论(0)
  • 2020-12-07 11:30

    The WCF Web API primarily focuses on REST implementations. If you are setting up a REST implementation, the standard WCF bits are a bit of a pain in the rear. If you are setting up RESTful services, you will find the WCF Web API a much nicer experience. If you are setting up SOAP services, then the WCF Web API is not your best friend, and you are better off using WCF for your services.

    0 讨论(0)
提交回复
热议问题