GlenW
Jul 22nd, 2005, 03:42 AM
I want to be able to switch between a local test Web Service and a server
based live Web Service.
When testing numerous web forms I need to switch their Web Service reference between a local development service and the live one.
At the moment this involves replacing the declaration 'TestWebService' with 'LiveWebService' in each form.
What I would like to do is have a utilities class that has a static function
that returns a reference to the appropriate web service depending upon a key
in web.config.
I would be able to do this if I knew how to declare the return value of the
function:
internal static ???????? GetWebService()
{
string lstrWebService =
ConfigurationSettings.AppSetting["WebService"].ToString();
if(lstrWebService == "Test")
{
return ????????;
}
else
{
return ????????;
}
}
Anyone know what the ?????????s should be or if what I want is not possible.
based live Web Service.
When testing numerous web forms I need to switch their Web Service reference between a local development service and the live one.
At the moment this involves replacing the declaration 'TestWebService' with 'LiveWebService' in each form.
What I would like to do is have a utilities class that has a static function
that returns a reference to the appropriate web service depending upon a key
in web.config.
I would be able to do this if I knew how to declare the return value of the
function:
internal static ???????? GetWebService()
{
string lstrWebService =
ConfigurationSettings.AppSetting["WebService"].ToString();
if(lstrWebService == "Test")
{
return ????????;
}
else
{
return ????????;
}
}
Anyone know what the ?????????s should be or if what I want is not possible.