C# 如何从C中的WCF Rest服务中获取方法名的所有URLMETABLE#

C# 如何从C中的WCF Rest服务中获取方法名的所有URLMETABLE#,c#,asp.net,rest,web-services,wcf,C#,Asp.net,Rest,Web Services,Wcf,我有一个rest服务URL,如下所示 此SVC有两种方法 [OperationContract] [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "UserLogin")] ResultInfo Login(Lo

我有一个rest服务URL,如下所示

此SVC有两种方法

[OperationContract]
    [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "UserLogin")]
    ResultInfo Login(Login objLogin);

[OperationContract]
    [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "SaveUser")]
    ResultInfo User(User objUser);
方法名是Login和User,但模板名是UserLogin和SaveUser

我想得到如下C#列表中的输出

UserLogin
SaveUser

需要您的帮助。

您可以使用以下方法获取方法名称

在ASPX页面中:

<asp:ListBox ID="lstMethodName" runat="server" Visible="true" AutoPostBack="true"
        Style="height: 150px; width:300px; overflow: auto;"></asp:ListBox>
添加名称空间:

 using System.Web.Services.Description;
 using System.Collections.Generic;

请尝试提供更多详细信息,如您想要什么以及如何填充列表?list str=new list();在这个字符串列表中,通过使用这个WCF服务URL,我需要URL模板名称
 using System.Web.Services.Description;
 using System.Collections.Generic;