Reputation: 21015
I'm developing an application that includs a web service, on development time I run the service locally on my pc, than I publish the service to a remote server, I wanna know how can I take the web reference that I got and just change the address of the service to the remote server to check that every thing is ok
Upvotes: 0
Views: 128
Reputation: 422212
Right click on your Web reference, click properties, and choose Url behavior: Dynamic in properies window. The URL of the Web service will be automatically mapped to a configuration option in the Web.config
file that you can change easily, without recompilation:
Upvotes: 1
Reputation: 11431
You can set the service URL usign the Url property:
MyWebService.Service1 service = new MyWebService.Service1();
service.Url = NEWSERVICEURL;
Upvotes: 1