Chen Kinnrot
Chen Kinnrot

Reputation: 21015

change asp.net 2 web service address

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

Answers (2)

Mehrdad Afshari
Mehrdad Afshari

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:

Screenshot

Upvotes: 1

Ryan Farley
Ryan Farley

Reputation: 11431

You can set the service URL usign the Url property:

MyWebService.Service1 service = new MyWebService.Service1();
service.Url = NEWSERVICEURL;

Upvotes: 1

Related Questions