/ Published in: Visual Basic
                    
                                        
Gets a list of web service server names from app.config
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
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
Comments
 Subscribe to comments
                    Subscribe to comments
                
                