Wcf 使用IIS 7.5在同一应用程序中承载多个服务

Wcf 使用IIS 7.5在同一应用程序中承载多个服务,wcf,iis,net.tcp,Wcf,Iis,Net.tcp,我有一个带有5个WCF服务的Visual Studio解决方案。他们都在同一个项目“MyCompany.MySoftware.Services”中 这一次,我将它们全部托管在IIS中(我习惯于使用Windows服务托管,但我计划使用AppFabric,因此我决定更改),并且我已经启用了HTTP和Net.TCP绑定 每个服务的配置如下所示: <service name="Kipany.Belvedere.Services.Services.AppointmentService"

我有一个带有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 - Is this a good architecture to use ? 2 - Can I face problems with this configuration ? 3 - What if I want to use every service in a different tcp port ? 4 - The port for tcp binding is configurated in the Default Website but I have the option to fill the 'address' in the endpoint, what happens in this case ? As I have to put ONE port in the Default Website binding, how can I use more than one port in my Web.Config ? 5 - My tcp is using the 808 port but this is my Client's Web.Config: 1-这是一个好的体系结构吗? 2-我可以面对此配置的问题吗? 3-如果我想在不同的tcp端口中使用每个服务,该怎么办? 4-tcp绑定端口在默认网站中配置,但我可以选择在端点中填充“地址”,这种情况下会发生什么?由于我必须在默认网站绑定中设置一个端口,如何在Web.Config中使用多个端口? 5-我的tcp正在使用808端口,但这是我客户端的Web.Config:

808端口在哪里

  • 这种建筑很好
  • 配置中没有任何固有的东西会给您带来问题
  • TCP使用的端口在IIS(站点绑定)中的站点级别配置,因此服务必须位于不同的站点才能使用不同的端口-端口和地址的其余部分用于路由请求,因此不同端口上的服务没有固有的优势
  • 如第3节所述-一个站点中的所有服务将使用相同的端口
  • 客户端需要完全限定地址,但在承载服务地址(包括端口)的IIS中,服务地址的定义是从IIS配置和.svc文件推断出来的

  • 所以只有一个端口可以轻松地处理所有请求?那么并发性呢?同时完成的两个请求将被并行处理,或者一个请求将等待另一个请求?这完全取决于您的服务实例和并发设置(我在这里写了这篇博客),但当然没有根本原因不能并行处理请求