Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to host a web service so other clients connected to same network can access

I am hosting web service in a one machine using Visual studio 2008. I tried accessing the web service from a web site i created in the same solution and it was successfully called. Now i want to access the web service from a remote client.

I initially developed the web service to used in an android application. As you can see if I wan to access the web service I will have to host is with a static IP. So at least to test the application i want access the web service from the android mobile by connecting both server and android mobile to one wifi network. For the initial test I connected two laptops(one is server) to the wifi router. And i pingd the server from the client machine and it got successfully pingd. But when i try to access the web service with given port from the browser it wont allow me to connect. I tried http://localhost:26796/ by replacing the localhost with ip of the server and also i tried making a small web site(asp) and try to access it from the client via IP. Both did not work. I have searched here and on web could not find a proper answer. for,

  1. how to host a webservice so other clients in the same network can access..?
  2. can it be fulfilled with VSD server..?
  3. is it compulsory to use iis..?
  4. How should i achieve this..?
like image 619
Gihan Avatar asked Nov 23 '25 06:11

Gihan


1 Answers

NOTE: Moved from comments to answer as per user suggestion.

Publish the web service to your local machine's IIS as an Application. Then you can access the site from anywhere in your network. Running it directly from VS means it's hosted inside VS's ASP.NET Development Server (which, by default is only accessible locally). You can try opening up the port specified in the ASP.NET development server that starts up on your machine's local firewall, then you can access the debug instance being hosted

like image 72
tobias86 Avatar answered Nov 24 '25 18:11

tobias86



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!