WCF 与 ASP .Net Web API [英] WCF vs ASP .Net Web API

查看:24
本文介绍了WCF 与 ASP .Net Web API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用每种技术的优缺点是什么?

What are the pros and cons of using each technology?

WCF Web Api 现已合并到 Asp.netAsp.net web api 现在支持自托管.

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

我仍然想,如果我想为同一个操作公开多个协议模式,我仍然会倾向于 WCF 还是 Mvc 端点也可以这样做?

I still imagine if I want to expose multiple protocol schemas for the same operation I would still lean towards WCF or can Mvc end point do this too?

新的 Asp.Net web api 是否也公开了 Wsdl?如果不是,客户如何确定他们可以使用哪些操作?

Also does the new Asp.Net web api expose Wsdl? If not how would the client figure out what operation is available to them?

可以说 Mvc 最好的特性是模型绑定器.WCF 等价物的稳健性如何?

Arguably the best feature of Mvc is the modelbinder. How robust is the WCF equivalent?

那么有人能告诉我 Asp.net web api 有什么优势吗?WCF 似乎绝对是更强大/可扩展的选择,imo.Mvc Web Api 相对于 WCF 模型的唯一优点可能是易于开发,但这意味着如果它最终成为一个严重的设计限制,那么这意味着蹲下.

So can someone tell me what advantage does the Asp.net web api bring to the table? WCF seems overwhelmingly the more powerful/scalable choice, imo. About the only thing the Mvc Web Api has over the WCF model is probably ease of development, but that means squat if it ends up being a serious design limitation down the road.

推荐答案

首先,我建议你阅读我关于这个主题的帖子:http://blogs.microsoft.co.il/blogs/idof/archive/2012/03/05/wcf-or-asp-net-web-apis-my-two-cents-on-the-subject.aspx

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

关于您的 WSDL 问题 - 由于 WebApi 不使用 SOAP,因此不需要 WSDL,也不会导出.您可以使用超媒体返回带有可能活动 URL 列表的资源(将其视为自描述资源)

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)

这篇关于WCF 与 ASP .Net Web API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆