2

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

I run it on ASP.NET development server.

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

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

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.

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

However I am getting an error 502: Connection failed

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

thanks

Y2theZ
  • 10,162
  • 38
  • 131
  • 200
  • 2
    To be able to call it from a remote computer, you need to set up a virtual directory in IIS. The ASP.NET development web server doesn't work for remote connections. – marc_s Oct 06 '13 at 17:56
  • @marc_s [There seems to be an option to do it](http://stackoverflow.com/a/2903703/107625). – Uwe Keim Oct 07 '13 at 05:26

2 Answers2

0

Just deploy and host it in IIS. Then you will get internal IP address as you are saying it is on under same network. Just test it with that local system's browseer where it is hosting at that moment and then check from another PC which is also under same network.

siddhesh
  • 367
  • 1
  • 3
  • 8
0

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?

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

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:

Tutorial to host on IIS

Obvious
  • 344
  • 1
  • 3
  • 16