Return to Snippet

Revision: 60393
at November 7, 2012 03:40 by ed_trench


Initial Code
Private Function GetWebServicesServerNames() As String

        Dim serverNames As New StringBuilder
        Dim appConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
        Dim serviceModel = ServiceModelSectionGroup.GetSectionGroup(appConfig)
        Dim bindings = serviceModel.Bindings
        Dim endpoints = serviceModel.Client.Endpoints

        For i = 0 To endpoints.Count() - 1
            Dim endpointElement = endpoints(i)
            serverNames.AppendLine(endpointElement.Address.Host)
        Next

        Return serverNames.ToString()

    End Function

Initial URL


Initial Description
Gets a list of web service server names from app.config

Initial Title
Get Web Services Server Names (app.config exe)

Initial Tags


Initial Language
Visual Basic