如何从WCF服务的方法? [英] How to get all methods from WCF service?

查看:141
本文介绍了如何从WCF服务的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得来自WCF Silverlight的支持服务的所有方法从code列表中。

How to get list of all methods from WCF silverlight enabled service from code.

我已经添加服务引用Silverlight应用程序。

I already have added service reference to Silverlight application.

我可以得到所有的方法使用反射?

Can I get all methods using Reflection?

如果可以请给我提供的例子。

If can please provide me example.

推荐答案

由于服务类的,你可以使用的 的getMethods功能打通反射所有方法的列表:

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;
}

这篇关于如何从WCF服务的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆