HI!
Server Endpoints :
<endpoint address ="http://localhost:8080/Greetings/ws" binding="wsHttpBinding" contract="Greetings.IGreeting"/>
<endpoint address ="http://localhost:8081/Greetings/basicI" binding="basicHttpBinding" contract="Greetings.IGreeting"/>
<endpoint address ="http://localhost:8091/Greetings/basicII" binding="basicHttpBinding" contract="Greetings.IGreeting"/>
Client EndPoints :
<endpoint address="http://localhost:8080/Greetings/ws" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IGreeting" contract="ServiceReference1.IGreeting"
name="WSHttpBinding_IGreeting">
<identity>
<userPrincipalName value="Navneet-PC\Navneet" />
</identity>
</endpoint>
<endpoint address="http://localhost:8081/Greetings/basicI" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IGreeting" contract="ServiceReference1.IGreeting"
name="BasicHttpBinding_IGreeting" />
<endpoint address="http://localhost:8091/Greetings/basicII" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IGreeting" contract="ServiceReference1.IGreeting"
name="BasicHttpBinding_IGreeting1" />
Client Program Main :
ServiceReference1.GreetingClient client = new ServiceReference1.GreetingClient(new BasicHttpBinding()
, new System.ServiceModel.EndpointAddress("http://localhost:8081/Greetings/basicII"));
Console.WriteLine(client.GoodEvening("Navneet"));
Console.ReadLine();
ServiceReference1.GreetingClient client = new ServiceReference1.GreetingClient(new BasicHttpBinding()
, new System.ServiceModel.EndpointAddress("http://localhost:8091/Greetings/basicII"));
Console.WriteLine(client.GoodEvening("Navneet"));
Console.ReadLine();
Here if you see for your clarity I have basicHttpBinding withdiffrent endpoint
basicI, basicII
similarly if you want to switch between wsHttpBinding and basicHttpBinding you also have to change the binding along with the address.
However you can also switch between the EnpPoint like
ServiceReference1.GreetingClient client = new ServiceReference1.GreetingClient("BasicHttpBinding_IGreeting1");
OR
ServiceReference1.GreetingClient client = new ServiceReference1.GreetingClient("
BasicHttpBinding_IGreeting");
Hope this helps!