tags:

views:

131

answers:

1

I'm using IIS7 to host a WCF service, so requests to the service endpoint address will be forwarded to the correct svc file. Obviously the client configuration has to specify an endpoint address of the service it wishes to consume, but why do I need to specify the endpoint address for the service in the service configuration (it throws an exception if I don't)?

This is an annoyance because I want to have the same service running on multiple machines in a web farm.

+1  A: 

From a network point of view, that's when you'd use a load balancer. You have to have an address of some sort to be able to find the machine providing the service. It's no different to the DNS part of a URL being used to locate a web server, or a DISPLAY variable being used to locate a X server.

A load balancer will allow you to use one single address which can then be delivered to one of many actual servers at the back end, assuming of course that it doesn't really matter which server services the request.

If you're more talking about the WCF address, that's an endpoint, analogous to a port in TCP/IP.

It's needed to distinguish between multiple WCF services. You may provide multiple endpoints for your particular arcitecture so there needs to be a way to separate them out.

It's usually better to be more adaptable than less.

paxdiablo
Thanks for response. I've updated my question to try to be a bit clearer. I'm talking about the service endpoint address, not the client. Why is the address needed to distinguish between services? IIS routes to a particular svc, that points to the class implementing a service.
JontyMC