home
links
tips

code
users
tools
tutorials
projects
web
help
design

mudabone
suletzki
trans48
nutrition reality

MarthaAttire!

Dynamically Change Webservice URL


Basically:

  1. register a webservice
  2. right click the webservice change URL Behavior to Dynamic
  3. click the 'show all files' icon in solution explorer
  4. in the web reference edit the Reference.cs file
  5. comment out the class constructor and change it to this

// public ArchivingFaxes() {
// string urlSetting = System.Configuration.ConfigurationSettings.AppSettings["FaxFiling.protus.ArchivingFaxes"];
// if ((urlSetting != null)) {
// this.Url = string.Concat(urlSetting, "");
// }
// else {
// this.Url = "https://www.protusfax.com/protus/xmlwebservices/archivingfaxes/archiving.asmx";
// }
// }
public ArchivingFaxes(string inputURL)
{
this.Url = inputURL;
}

Then you can set the URL when you instantiate the class.


back to tips



Comments:

From Ishai Sagi [212.143.56.110] - 5/9/05 1:52 AM

just beware not to "Update Web Referance" after the change


Last Modified 1/29/05 1:46 PM

Hide Tools