You can execute a method by name via Reflection. You need to know the type, as well as the method name (which can be the current object's type, or a method on a different object, or a static type). It looks like you want something like:
public void amethod(string functionName)
{
Type type = typeof(AVeryLargeWebServiceWithLotsOfMethodsToCall);
MethodInfo method = type.GetMethod(functionName, BindingFlags.Public | BindingFlags.Static);
method.Invoke(null,null); // Static methods, with no parameters
}
Edit in response to comment:
It sounds like you actually want to get a result back from this method. If that's the case, given that it's still a static method on the service (which is my guess, given what you wrote), you can do this. MethodInfo.Invoke will return the method's return value as an Object directly, so, if, for example, you were returning a string, you could do:
public string amethod(string functionName)
{
Type type = typeof(AVeryLargeWebServiceWithLotsOfMethodsToCall);
MethodInfo method = type.GetMethod(functionName, BindingFlags.Public | BindingFlags.Static);
object result = method.Invoke(null,null); // Static methods, with no parameters
if (result == null)
return string.Empty;
return result.ToString();
// Could also be return (int)result;, if it was an integer (boxed to an object), etc.
}