hi guys while i was working in Project one requirement cam across,
requirement was as follows
using/referencing web-service but should work on which ever machine my code runs(for e.g. staging server & production server).
function looks like this.
requirement was as follows
using/referencing web-service but should work on which ever machine my code runs(for e.g. staging server & production server).
so i came across a solution,when you add reference of any web-service you get .disco file on project-explorer window click on show all files you then be able to see some file in Reference Folder in that open .cs file
and search for this.Url after that just place code below
ConfigurationManager.AppSettings["EmployeeLog"].ToString();
public EmployeeStatus()
{
string str = ConfigurationManager.AppSettings["EmployeeLog"].ToString();
if (str != null)
{
this.Url = str;
}
else
{
this.Url = "";
}
}
now make Entry in web.config App-setting
that's it you are now all set to access web-service on any server.at-least you don't need to rebuild code again and again
No comments:
Post a Comment