问题
How to get list of all methods from WCF silverlight enabled service from code.
I already have added service reference to Silverlight application.
Can I get all methods using Reflection?
If can please provide me example.
回答1:
Given the type of the service class you could use the GetMethods function to get a list of all the methods through reflection:
MethodInfo[] methods = typeof(TypeOfTheService).GetMethods();
foreach (var method in methods)
{
string methodName = method.Name;
}
来源:https://stackoverflow.com/questions/2720617/how-to-get-all-methods-from-wcf-service