背景
我们在使用basicHttpBinding运行的Windows 服务中托管了WCF Web 服务。
问题
在本地计算机上浏览服务 URL 可以正常工作,但尝试使用外部 IP 地址(远程或本地)浏览则不起作用。例子:
http://localhost:8000/booking.svc
(好的)
http://<external-IP>:8000/booking.svc
(不好)
应用程序配置
<system.serviceModel>
<services>
<service behaviorConfiguration="DefaultServiceBehavior" name="HotelManagementSystem.ServiceHost.BookingService">
<endpoint address="" binding="basicHttpBinding" contract="HotelManagementSystem.ServiceHost.IBookingService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/booking.svc" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
有人有想法么?