简体   繁体   English

WCF服务应用程序VS ASP.NET Web应用程序?

[英]WCF Service Application VS ASP.NET Web Application?

I'm building a Web API to access my database. 我正在构建一个Web API来访问我的数据库。 I would like to create a Single Page Application Website first then a iPhone, Android and Windows application. 我想先创建一个单页应用程序网站,然后再创建一个iPhone,Android和Windows应用程序。 Classic. 经典。

My data and business layer are already finished. 我的数据和业务层已经完成。

  1. First I decided to build a Json WCF Webservice. 首先,我决定构建一个Json WCF Web服务。 In Visual Studio I created a WCF Service Application . 在Visual Studio中,我创建了WCF服务应用程序 I modified the Web.config file to accept Json requests and implemented my interface and svc file. 我修改了Web.config文件以接受Json请求,并实现了我的接口和svc文件。

  2. After that I discovered ASP.NET Web Application with the Web API template . 之后,我发现了带有Web API模板的 ASP.NET Web应用程序 So I decided to change and to create a real web API with this full website structure. 因此,我决定更改并使用此完整的网站结构创建一个真正的Web API。

Now I'm lost. 现在我迷路了。 What are the differences between these two possibilities to create a Web API? 这两种创建Web API的可能性有什么区别?

A comparative from microsoft : http://msdn.microsoft.com/en-us/library/jj823172(v=vs.110).aspx 来自Microsoft的比较: http : //msdn.microsoft.com/zh-cn/library/jj823172 (v= vs.110).aspx

Personnaly, I prefer WCF because the datacontracts are generated in the case of SOAP Web Services with WSDL files. 就个人而言,我更喜欢WCF,因为在使用WSDL文件的SOAP Web服务的情况下,会生成数据合同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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