开发者

Get listing of web services referenced in WCF application?

Could anyone out there give some pointers on how to go about getting a listing of all the web service references used by a WCF application - the pseudo code I'm envisioning might look something like:

For each ws in MyWebServices Console.Write开发者_开发知识库Line("Service Name: " & ws.Name) Next

How to build the MyWebServices object is what I am wondering?

Thanks


You should be able to do:

ClientSection clientSection = (ClientSection)ConfigurationManager.GetSection("system.serviceModel/client");

foreach(ChannelEndpointElement channelEndpointElement in clientSection.Endpoints)
{
    // Use any of the channel endpoint element properties here:
    // Address, BehaviorConfiguration, Binding, BindingConfiguration, Contract, etc.
}


You could just check the configuration file. All WCF services used by the application should be in the client section.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜