Se connecter à un service Wcf par un string
Bonjour à tous,
Je vais développer une application avec un pool de services web Wcf et j'aimerais pouvoir rendre générique les connexions à ces services.
Code:
1 2 3 4 5 6 7 8
|
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:4684/Service1.svc");
//Ici j'aimerais que ServiceContract1 soit un string
ChannelFactory factory = new ChannelFactory<ServiceContract1>(binding, address);
ServiceContract channel = factory.CreateChannel();
string resturnmessage = channel.YourMethod("test"); |
J'aimerais pouvoir me connecter au service Web "ServiceContract1" par une chaine contenant son nom.
Merci beaucoup par avance.
Eric.