简体   繁体   中英

Accessing Webservice API from another PC

I am a complete beginner and made a sample REST Webservice on my PC. I want to call the GET API from another PC, which is connected to my PC via ethernet cable.

I am already able to access the API from another PC through IP address in the URL. For this, I had to change the binding protocol as mentioned in this blog post . Basically, I added a line <binding protocol="http" bindingInformation="*:58938:192.168.1.42" /> in the file /{project folder}/.vs/config/applicationhost.config , where 192.168.1.42 is the IP address of my PC.

PROBLEM: Since the web service will run at different customer's PC so, I will not have any information about the IP address. Therefore, I need a solution where I don't need to add the IP address in the applicationhost.config file.

Is there a way that I can make a fixed URL with which I can access the web service from any other PC via http (both the PC connected by ethernet cable).

将服务器托管在客户端PC IIS上时,通过提供PORT而不是说9000,使Client PC的IP静态为192.168.1.1,那么您可以使用Web API通过调用192.168.1.1:9000来使用能够访问API。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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