【发布时间】:2017-06-19 13:11:47
【问题描述】:
我有一个使用 IIS8 在 Azure Windows Server 2012 上运行的现有 WCF REST 服务。假设 1x.2x.3x.4x:7777/InvService.svc/RESTquery 是我的用户当前使用该服务的方式。
我想用主机名替换 IP 地址,比如 www.testDomain.com,这样用户就可以使用 www.testDomain.com:7777/InvService.svc/RESTquery。
从 GoDaddy 获取域名后,分配 IP 1x.2x.3x.4x,并对其进行测试(我在服务器上的默认站点出现,因此我使用端口 7777)。当我尝试 www.testDomain.com:7777/InvService.svc/RESTquery 时,我收到“连接超时”错误。
我相信我需要在我的 Web.config 文件中添加或更改某些内容,但似乎找不到正确的答案。这是我当前不成功的 Web.config 文件的样子。
<services>
<service name="WCFInventoryService.InvService">
<endpoint address="RESTquery" behaviorConfiguration="restPoxBehavior"
binding="webHttpBinding" contract="WCFInventoryService.IInvService" />
<identity>
<dns value="www.testDomain.com" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://www.testDomain.com/"/>
</baseAddresses>
</host>
</service>
</services>
我做错了什么?还是应该试试?
【问题讨论】:
标签: rest wcf web-hosting