views:

125

answers:

1

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.

+3  A: 

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;
}
Darin Dimitrov
Thanks, but it does not work. I already tried it.
bgodiy
*Doesn't work* is not a very precise problem description that could allow me to help.
Darin Dimitrov
Sorry. It works. I made a mistake.
bgodiy