简体   繁体   English

Windows Azure-在Web角色的虚拟目录中包括WCF服务

[英]Windows Azure - Include a WCF service in a virtual directory of a web role

Is it possible to have a wcf service role live in a virtual directory (or the equivalent not sure if that word is the appropriate one for Azure) of a web role on Azure. 是否可以在Azure上的Web角色的虚拟目录中驻留wcf服务角色(或不确定该词是否适合Azure)。

For example: 例如:

www.mydomain.com                  <- contains the web role or website
www.mydomain.com/myservice.svc    <- contains the WCF service

I've seen people suggest that you can change the config to allow for virtual directories, however I have RDPed into both VMs and they appear not to share the same files on disk. 我见过有人建议您可以更改配置以允许虚拟目录,但是我已经将RDP绑定到两个VM中,它们似乎不共享磁盘上的相同文件。

I am Azure newbie, please forgive the terminology. 我是Azure新手,请原谅术语。 But is it possible to do what I am wanting? 但是可以做我想做的吗?

A web site and a WCF service can be accessed using the URLs you listed above if they are both in the same web role. 如果网站和WCF服务都在同一Web角色中,则可以使用上面列出的URL访问它们。 You will get the URLs you describe above if you do the following: 如果执行以下操作,则将获得上面描述的URL:

  1. Create a new cloud project in Visual Studio, specifying a Windows Azure Cloud Service. 在Visual Studio中创建一个新的云项目,并指定Windows Azure云服务。
  2. At the prompt, add an MVC web role. 在提示符下,添加MVC Web角色。
  3. At the next prompt, select Internet Application and press OK. 在下一个提示符下,选择“ Internet应用程序”,然后按OK。
  4. When the project is created, right click on the MVC project and choose Add --> New Item --> WCF Service. 创建项目后,右键单击MVC项目,然后选择添加->新建项目-> WCF服务。
  5. Press F5. 按F5。 The default ASP.NET MVC home page will show up. 将显示默认的ASP.NET MVC主页。 Then navigate to http://yourlocalhostaddress/Service1.svc . 然后导航到http://yourlocalhostaddress/Service1.svc You'll see the typical "You have created a service" landing page for a new WCF service. 您将看到新WCF服务的典型“您已创建服务”登录页面。

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

相关问题 如何配置Windows Azure WCF服务Web角色以使用netTcpBinding? - How to configure a Windows Azure WCF Service Web Role to work with netTcpBinding? Windows Azure Web角色中的会话过期问题 - Session expire issue in windows Azure web role 是使用辅助角色还是Web角色:Windows Azure - Whether to use a worker role or a web role : Windows Azure 在Windows Azure辅助角色和Web角色中使用SignalR - using SignalR in Windows Azure worker role(s) and in web role(s) 我已经使用云服务,windows azure创建了Web应用程序,现在我要在2个以上的环境中部署Web角色 - I've created web application with cloud service, windows azure,right now i am deploying my web role on more then 2 environment 用于远程Web服务的Windows虚拟磁盘 - Windows virtual disk for remote web service 使用Hosted Web Core在Windows Azure Web角色中提供.ogg - Serve .ogg in Windows Azure Web Role using Hosted Web Core 由于 Windows 更新,Azure 云服务应用程序(Web 角色)偶尔会停机约 10 分钟? 我该如何安排他们? - Azure cloud service app (web role) goes down for ~10 mins occasionally due to Windows Updates? How can I schedule them? 如何在Windows Azure Web角色上设置Splunk通用转发器? - How to setup Splunk Universal Forwarder on Windows Azure web role? 通过Internet访问Azure虚拟机上的自托管WCF服务 - Access to a self-hosted WCF service on azure virtual machine over the Internet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM