Reputation: 6068
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.
Upvotes: 0
Views: 766
Reputation: 53
To allow broader range of clients to access service who are on platforms other than .Net, there must be a unified way that tells clients ,"Hey buddy,here I am the exact service you are looking for.You can find me at this location (i.e Address),connect to me with these many protocols (i.e.Binding) and This is the contract we sign for communication." So in a nutshell, endpoint is necessary to let clients know where the service can be found.
Now in your case, you know the endpoint hence you can configure the client. But for those clients who don't know this,must need to approach service. Endpoint is a like visiting card of service given to clients
Upvotes: 0
Reputation: 11
I do have the same concern. if i know the address of the endpoint to consume, why do i need to specify that address explicitly in the endpoint. Recently i have created a webHttpBinding endpoint without specifying the address and i was able to access the contract successfully. this service was hosted part of asp.net development server . is address required when hosting under IIS?. or address is required for any other bindings like wsHttpBinding,TCPBinding etc ?.
Upvotes: 1
Reputation: 882776
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.
Upvotes: 3