[SOLVED] Dynamically switch WCF Web Service Reference URL path through config file

Issue

How do you dynamically switch WCF Web Service Reference URL path through config file ?

Solution

Are you just wanting to override the URL that is in the config to a different url. Say you have a test service and a live service. You can just do this.

client.Endpoint.Address = new EndpointAddress(Server.IsLiveServer() ?
    @"LiveUrl" : @"TestURl"); 

Where those url come from wherever you want

Answered By – Erin

Answer Checked By – Gilberto Lyons (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *