简体   繁体   English

在Windows Azure上测试WCF服务

[英]Testing WCF service on Windows Azure

I created a WCF service in Windows Azure project (with 1 WCF Service Web Role). 我在Windows Azure项目(带有1个WCF服务Web角色)中创建了WCF服务。

How can I test it at my local machine? 如何在我的本地计算机上对其进行测试? If I want to write an application, which makes a request to this service, what reference in the application should I add? 如果要编写一个向该服务发出请求的应用程序,应在该应用程序中添加什么引用?

When I press F5 in this project, it shows me a web page in browser, where it is written "HTTP error 403.14 - Forbidden". 当我在该项目中按F5时,它将向我显示浏览器中的网页,该网页的内容为“ HTTP错误403.14-禁止访问”。

Sorry for such a silly question =) 很抱歉这么愚蠢的问题=)

使用uri将测试引用的服务引用添加到Azure上公开的服务

Set the Azure project as the start up project. 将Azure项目设置为启动项目。 This will start the azure emulator which will host your wcf service on localhost. 这将启动azure仿真器,该仿真器将在本地主机上托管您的wcf服务。 I believe it automatically opens a browser with your site loaded. 我相信它会在您的网站加载后自动打开浏览器。 If not, you can always check out the emulator itself in your system tray to get the ports (very similar to the way you would with development server). 如果没有,您总是可以在系统托盘中检出仿真器本身以获取端口(非常类似于开发服务器的方式)。 Of course you must be on the correct path to your service as well. 当然,您也必须在正确的服务途径上。

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

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