承载WCF的最佳方法,以便可以在Internet上看到它. [英] The best way to host WCF, so that it will be visible in the internet.

查看:89
本文介绍了承载WCF的最佳方法,以便可以在Internet上看到它.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


因此,简而言之,我想实现一些互联网上可见的方法.
我认为WCF是最好的方法,但是我对如何托管它感到有些困惑.
我正在考虑两种方法:
1.由IIS在www服务器上托管.
2.由Windows Service托管,在我的计算机上运行,​​并且已连接到Internet.



抱歉,我必须改善我的问题,我不想再开始一个新问题:
在这种情况下,哪种方法会更好:
-我的大多数WCF方法仅在Intranet(专用计算机网络)中使用.对于egzample-功能-发送电子邮件.因此,我的网络已连接到全球互联网.
-当连接断开并且有人要发送电子邮件时-该电子邮件将保存在DB中,以备将来使用.
-将有一个网页-带有日志,其中包含有关已发送电子邮件的信息.因此,我的网站可能需要使用WCF函数"getLog"或类似的东西.
我认为:Windows服务,它将检查DB中是否有任务要做(会有很多任务-不仅是未来"电子邮件).相同的Windows服务将托管WCF功能,例如为本地计算机提供发送电子邮件" ..为我的网站提供显示日志".
这就是为什么我认为Windows服务托管会更好.是(在那种情况下)?

Hi,
So, in a nutshell, i want to implement some methods visible in the internet.
I think WCF, will be the best way, but i''m a little confused about how to host it.
I''m thinking about two ways:
1. Host by IIS, on www server.
2. Host by Windows Service, running on my computer, ofc connected to the internet.


edit:
Sorry, I have to improve my question, i don''t want to start new one:
Which way will be better, in that situation:
- most of my WCF''s methods will be used only in intranet - private computer network. For egzample - function - send email. So my network with have connection to global internet.
- when connection is lost, and someone want to send email - this email will be saved in DB as a tast to do in future.
- there will be a web page - with a log, with information about sent emails. So my web need to use probablly a WCF function "getLog" or sth like that.
I think: Windows service, which will be checking if there is a task to do in DB (there will be a lot of task - not only a ''future'' email). the same windows service will host a WCF functions such as "send email" for local machines.. and "show log" for my web site.
That is why I thought hosting by windows service will be better. It is (in that situation) ?

推荐答案

我认为在IIS中托管会更容易且更合适.
I reckon hosting in IIS would be easier and more suitable.


最好方式是通过Web服务器上的IIS. *您的机器*不会总是打开,或者可能会遇到影响您提供服务能力的问题.除此之外,大多数ISP都不允许您在家中运行Web服务器.
The best way is via IIS on a web server. *Your* machine won''t always be turned on, or could be experiencing problems that affect your ability to serve the service. Beyond that, most ISPs don''t allow you to run a web server from your house.


您不需要WCF发送邮件.您只需使用适当的内置框架对象. WCF用于客户端和服务器之间的通信.

如果是我,我将让Windows服务执行检查/电子邮件操作,但是该网站仍将在IIS上运行,并且可以访问数据库以获取想要显示给用户的任何内容.使Windows服务与网站进行通信是毫无意义的.
You don''t need WCF to send mail. You simply use the appropriate built in framework objects. WCF is for communicating between a client and a server.

If it were me, I''d have the windows service doing the check/email thing, but the web site would STILL be running on IIS, and would access the database for whatever you wanted to display to the user. Making the windows service communicate with the web site is kinda pointless.


这篇关于承载WCF的最佳方法,以便可以在Internet上看到它.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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