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.
精彩评论