I have code that references a web service, and I\'d like the address of that web service to be dynamic (read from a database, config file, etc.) so that it is easily changed
I know this is an old question, but our solution is much simpler than what I see here. We use it for WCF calls with VS2010 and up. The string url can come from app settings or another source. In my case it is a drop down list where the user picks the server. TheService was configured through VS add service reference.
private void CallTheService( string url )
{
TheService.TheServiceClient client = new TheService.TheServiceClient();
client.Endpoint.Address = new System.ServiceModel.EndpointAddress(url);
var results = client.AMethodFromTheService();
}