I have generated a webservice client (Service Reference) from a wsdl file provided by a web service. This webservice runs on 2 (or more) machines. What I like to do is to call from a single client (a windows service) both machines in a round robin fashion. If one of the webservices is offline the client should automatically choose the other instance.
The app.config file is very simple:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="MyServicePortBinding" messageEncoding="Mtom"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://server:8080/myservice/services" binding="basicHttpBinding"
bindingConfiguration="MyServicePortBinding" contract="Service.MyService"
name="MyServicePort1" />
</client>
</system.serviceModel>
What I tried is to add a second endpoint to the configuration. This does fail with the exception: System.InvalidOperationException: An endpoint configuration section for contract 'Service.MyService' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.
Do you have any ideas how to set up a simple wcf loadbalancing mechanism on the client side?
Cheers
Fabian
Edit: This is not a duplicate to the linked question. The question here is how to implement a client based loadbalancing, not what happens if I put in 2 endpoints. This was only what I came up with.