我有一个带有 5 个 WCF 服务的 Visual Studio 解决方案。它们都在同一个项目“MyCompany.MySoftware.Services”中。
这一次,我将它们全部托管在 IIS 中(我习惯于使用 Windows 服务进行托管,但我计划使用 AppFabric,所以我决定更改)并且我已经启用了使用 HTTP 和 Net.TCP 绑定。
每个服务的配置如下:
<service name="Kipany.Belvedere.Services.Services.AppointmentService"
behaviorConfiguration="GeneralBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="Company.Software.Services.IService1"
name="appointmenthttp"/>
<endpoint address="" binding="netTcpBinding"
bindingConfiguration="netTcpBindingConfig"
name="appointmenttcp"
contract="Company.Software.Services.IService1"/>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
<service name="Kipany.Belvedere.Services.Services.AppointmentService"
behaviorConfiguration="GeneralBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="Company.Software.Services.IService5"
name="appointmenthttp"/>
<endpoint address="" binding="netTcpBinding"
bindingConfiguration="netTcpBindingConfig"
name="appointmenttcp"
contract="Company.Software.Services.IService5"/>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
我在这篇文章中读到,在 IIS 中托管时,我必须让我的 netTcp 端点没有地址。目前,我的 IIS 配置了 808 端口,所以我知道我所有的服务都在使用这个端口。
问题:
1 - 这是一个很好的架构吗? 2 - 我可以面对这个配置的问题吗? 3 - 如果我想在不同的 tcp 端口中使用每个服务怎么办? 4 - tcp 绑定的端口是在默认网站中配置的,但我可以选择在端点中填写“地址”,在这种情况下会发生什么?由于我必须在默认网站绑定中放置一个端口,我如何在我的 Web.Config 中使用多个端口? 5 - 我的 tcp 使用 808 端口,但这是我客户端的 Web.Config:
808端口在哪里?