我可以在单个IP地址上托管asp.net网站和WCF服务吗? [英] Can I Host asp.net website and WCF service on single IP adress.

查看:86
本文介绍了我可以在单个IP地址上托管asp.net网站和WCF服务吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我创建了一个asp.net Web应用程序和wcf服务应用程序。 WCF服务正在向asp.net Web应用程序提供数据。

我只有一个服务器IP,是否可以在同一服务器上使用相同的ip托管wcf服务和asp.net Web应用程序。

请回复一些指导。

提前谢谢..

Hi,

I created an asp.net web application and wcf service application. WCF service is serving data to the asp.net web application.
I have only one server IP, is it possible to host wcf service and asp.net web application on the same server with the same ip.
Please respond with some guidence.
Thanks in advance..

推荐答案

是的,这确实是可能的。



首先是单独的应用程序/项目/解决方案中的wcf?



如果在网络中托管应用程序,这很容易实现,因为网站和服务都来自同一个地方。如果是单独的应用程序/服务,则需要在IIS框中配置一个单独的网站(假设您使用的是基于HTTP的wcf)。



一旦设置好了您可以使用主机标头区分这两个站点。主机头用于识别请求并根据名称将它们重定向到同一个ip。 IIS根据请求标头将请求重定向到正确的站点。



主机标头

http://technet.microsoft.com/en-us/library/cc753195(v=ws.10)。 aspx [ ^ ]



WCF IIS

http://www.youtube.com/watch?v=mX8quq7MoeI [ ^ ]

关于如何托管WCF服务的初学者教程(IIS托管和自托管) [ ^ ]
Yes this is indeed possible.

Firstly is the wcf in a seperate application / project / solution?

If hosted inside the web app, this is very easy to accomplish as the site and service all get fed from the same place. If a separate application / service you will need to configure a separate website on your IIS box (assuming you are using HTTP based wcf).

Once you have set this up you can distinguish between the two sites using host headers. Host headers are used to recognize requests and re-direct them based on name to the same ip. IIS re-directs the request to the correct site based on the request header.

Host headers
http://technet.microsoft.com/en-us/library/cc753195(v=ws.10).aspx[^]

WCF IIS
http://www.youtube.com/watch?v=mX8quq7MoeI[^]
A Beginner's Tutorial on How to Host a WCF Service (IIS Hosting and Self Hosting)[^]


这篇关于我可以在单个IP地址上托管asp.net网站和WCF服务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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