Web服务器技术咨询 [英] Consulting on technology for web server

查看:65
本文介绍了Web服务器技术咨询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi all,

我是开发Web服务器的新手.我想向您咨询并获得有关使用C#开发Web服务器应使用的技术的帮助.

I am new in developing web servers. I would like to consult with you and get your help on which technology I should use in order to develop a web server in C#.

要求:

  1. 它应该支持单个客户端.
  2. 它接收来自Web客户端的请求并运行SQL脚本.
  3. 不需要具有可伸缩性.不需要支持数千个请求.
  1. The server should support HTTPS.
  2. It should support single client.
  3. It is basically a proxy. Meaning, it will run on Windows server 2012.
  4. It receives requests from web client and run SQL scripts. It should return the results as JSON.
  5. It should support few users including authentications.
  6. It is not required to have scalability. It is is not required to support thousands of request.
  7. It will probably support some APIs (REST). 

I know there are few technologies IIS web servers, HTTPListeners, etc'. 

您认为什么是正确的技术?如果您还可以向我发送指向教程的链接以便我进行判断,我将不胜感激.

What do you think is the right technology? I'd appreciate if you can also send me links to tutorials so i can judge.

谢谢你.

你错了,我是伙计...

You got the wrong guy, I'm the dude...

推荐答案

您好eyasso,

Hi eyasso,

在我的选择中,我建议您创建WCF Rest Service,该服务可以托管在Windows Server 2012的IIS中.

In my option, I would suggest you create WCF Rest Service which could be hosted in IIS on Windows Server 2012.

您可以参考下面的链接以在IIS中进行托管.
#RESTful WCF体系结构–在IIS中托管RESTful WCF服务
https://blogs .msdn.microsoft.com/alikl/2010/06/06/restful-wcf-architecture-hosting-restful-wcf-services-in-iis/

You could refer the link below for hosting in IIS.
#RESTful WCF Architecture – Hosting RESTful WCF Services in IIS
https://blogs.msdn.microsoft.com/alikl/2010/06/06/restful-wcf-architecture-hosting-restful-wcf-services-in-iis/

要返回JSON,可以尝试ResponseFormat = WebMessageFormat.Json.

For returning JSON, you could try ResponseFormat= WebMessageFormat.Json.

[ServiceContract]
public partial class BookmarkService
{
    ...
    [WebInvoke(Method = "POST", RequestFormat=WebMessageFormat.Json,
        UriTemplate = "users/{username}/bookmarks?format=json")]
    [OperationContract]
    void PostBookmarkAsJson(string username, Bookmark newValue)
    {
        HandlePostBookmark(username, newValue);
    }
    [WebGet(ResponseFormat= WebMessageFormat.Json,
        UriTemplate = "users/{username}/bookmarks/{id}?format=json")]
    [OperationContract]
    Bookmark GetBookmarkAsJson(string username, string id)
    {
        HandleGetBookmark(username, id);
    }
    ...
}

IIS支持身份验证,您可以参考下面的链接:

IIS supports authentication, you could refer the link below:

#IIS 8安全最佳实践
https://technet.microsoft.com/en-us/library/jj635855 (v = ws.11).aspx

#Security Best Practices for IIS 8
https://technet.microsoft.com/en-us/library/jj635855(v=ws.11).aspx

#身份验证功能要求(IIS 7)
https://technet.microsoft.com/en-us/library/cc755253.aspx

#Authentication Feature Requirements (IIS 7)
https://technet.microsoft.com/en-us/library/cc755253.aspx

最好的问候,

Best Regards,

爱德华


这篇关于Web服务器技术咨询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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