简体   繁体   English

使用 WCF 创建 web API

[英]Creating a web API using WCF

I was assigned to design and develop an API which will expose our functionality over the web, I am fairly new to this, so I got some questions...我被指派设计和开发一个 API,它将在 web 上公开我们的功能,我对此很陌生,所以我有一些问题......

The Requests请求

  1. The API should support clients from all sorts of platforms and API 应该支持来自各种平台的客户端和
    programming languages (may include some propriety platforms/devices)编程语言(可能包括一些专有平台/设备)

  2. The API will be exposed to paying clients and secured by SSL (this is a must, money is invloved) API 将暴露给付费客户,并由 SSL 保护(这是必须的,钱是有钱的)

  3. Our code is in .NET, so WCF should be used.我们的代码在 .NET,所以应该使用 WCF。

After some research around the web I'm thinking about the following solution:在对 web 进行一些研究后,我正在考虑以下解决方案:

  1. Exposing the methods through POST/GET (other bindings if needed)通过 POST/GET 公开方法(如果需要其他绑定)

  2. For additional client identification and Authorization password and username will be sent as parameters.对于额外的客户端标识和授权密码和用户名将作为参数发送。

  3. Should I use WCF Web API, or is it unnecessary?我应该使用WCF Web API,还是没有必要?

In the article Exposing WCF API - Best Practices , I read that if the channel is SSL secured, then simple username/password is the simplest way for Authorization purposes暴露 WCF API - 最佳实践的文章中,我读到如果通道是 SSL 安全的,那么简单的用户名/密码是最简单的授权方式

I don't know if I should elaborate and explain more, but am I on the right track?我不知道我是否应该详细说明和解释更多,但我在正确的轨道上吗?

I don't see a reason why you shouldn't use WCF.我看不出你不应该使用 WCF 的理由。 You should have look at WCF REST programming model too http://msdn.microsoft.com/en-us/netframework/cc950529 . You should have look at WCF REST programming model too http://msdn.microsoft.com/en-us/netframework/cc950529 .

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

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