测试从另一台电脑一个WCF Web服务在同一网络上 [英] Test a wcf webservice from another PC on the same network

查看:119
本文介绍了测试从另一台电脑一个WCF Web服务在同一网络上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了Visual Studio 2010的一个简单的Web服务的WCF

I have created a simple wcf webservice on visual studio 2010.

我ASP.NET开发服务器上运行。

I run it on ASP.NET development server.

我尝试调用一个简单的得到服务的本地使用本地URL的浏览器:

I try to call a simple GET service local on a browser using the local url:

http://localhost:15021/MyService.svc/getData/test

这工作,我得到一个正确的JSON结果。我也试过在提琴手和其工作。

That works and I get a correct JSON result. I also tried on fiddler and its working.

我想从连接在同一个网络上的另一台计算机上调用它。

I would like to call it from another computer connected on the same network.

我得到了我从CMD本地IPv4,并试图用它来代替其他的PC

I got my local IPV4 from cmd and tried to replace the localhost with it on the other PC

http://10.0.0.14:15021/MyService.svc/getData/test

不过,我正在一个错误502:连接失败

我怎么能叫我ASP.NET开发服务器上运行的服务从另一台PC /移动在同一网络上?

How can I call the services that I run on ASP.NET development server from another PC/Mobile on the same network?

感谢

推荐答案

同样的事情发生在我身上。问题是IIS前preSS,它不容许你的网站从其他计算机访问同一个网络上。通过deault Visual Studio中使用IIS前preSS。所以,您将无法使用IIS前preSS时访问它。那么怎么办?

Same thing happened to me. The problem is iis express, it doesnt allow your website to be accessible from other machine on the same network. Visual studio by deault uses iis express. So you wont be able to access it , when using iis express. So what to do?

安装最新的IIS或尝试使用启用控制面板>程序已经安装IIS>打开Windows功能打开或关闭> Internet信息服务

Install latest IIS or try enabling the already installed iis using Control Panel> Programs > Turn Windows features On or OFF > Internet Information Services

安装/使您可以通过在命令提示符处键入INET​​MGR启动IIS后。一旦IIS是建立和运行,你可以使用本教程上传您的网站:

After installing/enabling you can start iis by typing inetmgr in command prompt. Once IIS is up and running you can use this tutorial to upload your website:

教程主办IIS

这篇关于测试从另一台电脑一个WCF Web服务在同一网络上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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