I have an application where users will connect to one or more WCF services running on machines in their network. Because the address of these connections are not known at the time of installation, the application must programmatically connect to these services (i.e. I cannot use Add Service Reference). I have the connection working using the following code:
string url = "...the url...";
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress(url);
ILicenseService service = ChannelFactory<ILicenseService>.CreateChannel(binding, address);
However, some of the members of my service class return an ObservableCollection
of elements. I know how to change the collection type in the Service Reference dialog box, using Advanced settings. However, I cannot figure out a way to set this value programatically so that my client knows to read the return type as an ObservableCollection
instead of a List. Any clues?