简体   繁体   English

如何在Windows Azure Web App上发布的asp.net网站中访问Web服务

[英]How to to access web service in asp.net web site whcih publish on windows azure Web App

I am building a C# web service. 我正在构建一个C#Web服务。 It works fine in Visual Studio 2013. I deployed it on IIS in a Windows Azure VM, and this also works fine. 它可以在Visual Studio 2013中正常工作。我将其部署在Windows Azure VM的IIS上,也可以正常工作。 This web service is basically used for getting data such as event logs and start/stop service lists from the remote machine. 该Web服务基本上用于从远程计算机获取事件日志和启动/停止服务列表等数据。 I am consuming this web service in another ASP.NET web site as a Web Reference. 我正在另一个ASP.NET网站中使用此Web服务作为Web参考。 This client web site accesses the data from the web service perfectly when debugging locally in Visual Studio. 在Visual Studio中进行本地调试时,此客户端网站可以完美地从Web服务访问数据。

Now I want to deploy the client web site to another VM on the same live domain which uses the web service in Windows Azure Web Apps. 现在,我想将客户端网站部署到使用Windows Azure Web Apps中的Web服务的同一活动域中的另一个VM。 When I do this, it gives the following error: 当我这样做时,它给出以下错误:

An attempt was made to access a socket in a way forbidden by its access permissions 127.0.0.1:8080 尝试以其访问权限127.0.0.1:8080禁止的方式访问套接字

Is there a way that I can access a web service which is deployed on a domain joined machine in a Windows Azure Web Apps site? 有什么方法可以访问部署在Windows Azure Web Apps站点中加入域的计算机上的Web服务?

Please help me and give me any suggestions to resolve this error. 请帮助我,并给我任何解决此错误的建议。

Thanks 谢谢

I notice that the port that you have listed is 8080 . 我注意到您列出的端口是8080 I strongly suspect that port will be blocked by default on the VM firewall. 我强烈怀疑默认情况下该端口将在VM防火墙上被阻止。 Assuming it's a VM, you should be able to open that up in the Windows Firewall. 假设它是VM,您应该能够在Windows防火墙中将其打开。

Alternatively, move the application to be deployed on port 80 instead, as this will be open by default. 另外,也可以将应用程序部署在端口80上,因为默认情况下它将打开。

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

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