0
votes

I have a Visual Studio Solution with 5 WCF services. They all are in the same project "MyCompany.MySoftware.Services".

This time, I am hosting them all in IIS (I am used to host using with Windows Services but I am planing to use AppFabric so I decided to change) and I have enabled consuming with HTTP and Net.TCP bindings.

The configuration of every service is as follow:

<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>

I read in this post that I have to let my netTcp endpoint without address when hosting in IIS. For now, my IIS is configurated with 808 port so I understand that all my services are using this port.

Questions:

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:

Where is the 808 port ?

1

1 Answers

0
votes
  1. this architecture is fine
  2. there is nothing inherent in the configuration that will cause you problems
  3. The port that TCP uses is configured at the site level in IIS (the site binding) so the services would have to be in different sites to use different ports - the port and the rest of the address is there for routing the request so there is no inherent advantage to the services being on different ports
  4. As said in 3 - all services in one site will use the same port
  5. the client needs to fully qualify the address but in IIS hosting the definition of the service address (including the port) is inferred from the IIS configuration and .svc file