具有动态 IP 地址的本地网络上的 WCF 服务 [英] WCF Service on local network with Dynamic IP Address
问题描述
我是 WCF 的新手.
I'm a newbie to WCF.
我了解到为了在本地网络服务器中寻址 WCF 服务,我必须将 baseAddress 设置为本地服务器的 IP 地址.
I learnt that in order to address a WCF Service in my local network server, I have to set a baseAddress to the IP Address of my local server.
但是如果我的 Internet 服务提供商采用动态 IP 方法会发生什么,据我所知,我的本地网络机器的所有 IP 地址都会随着时间的推移而改变,您建议我怎么做?
But what happens if my Internet Service Provider works on a Dynamic IP approach, as I understand it all IP Addresses of my local network machines can change over time, what do you suggest me to do?
推荐答案
您的基地址目前采用以下格式:http://127.0.0.1:8734/Myservice
.
Your base address is currently something in the format of: http://127.0.0.1:8734/Myservice
.
您可以尝试 http://Domain.MyLocalServerName:8734/Myservice
网络 DNS 服务器应该将 Domain.MyLocalServerName
请求解析为当前 IP 地址.
You could try http://Domain.MyLocalServerName:8734/Myservice
the networks DNS server should resolve the request to Domain.MyLocalServerName
into the current IP address.
链接到 获取来自 IP 地址的主机名.
这篇关于具有动态 IP 地址的本地网络上的 WCF 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!