Opc.Ua.Server.StandardServer.GetEndpoints C# (CSharp) Method

GetEndpoints() public method

Invokes the GetEndpoints service.
public GetEndpoints ( RequestHeader requestHeader, string endpointUrl, StringCollection localeIds, StringCollection profileUris, EndpointDescriptionCollection &endpoints ) : ResponseHeader
requestHeader RequestHeader The request header.
endpointUrl string The endpoint URL.
localeIds StringCollection The locale ids.
profileUris StringCollection The profile uris.
endpoints EndpointDescriptionCollection The endpoints supported by the server.
return ResponseHeader
        public override ResponseHeader GetEndpoints(
            RequestHeader                     requestHeader,
            string                            endpointUrl,
            StringCollection                  localeIds,
            StringCollection                  profileUris,
            out EndpointDescriptionCollection endpoints)
        {   
            endpoints = null;
            
            ValidateRequest(requestHeader);

            lock (m_lock)
            {
                // filter by profile.
                IList<BaseAddress> baseAddresses = FilterByProfile(profileUris, BaseAddresses);

                // get the descriptions.
                endpoints = GetEndpointDescriptions(
                    endpointUrl,
                    baseAddresses,
                    localeIds);
            }

            return CreateResponse(requestHeader, StatusCodes.Good);
        }

Usage Example

        /// <summary>
        /// Creates a form which displays the status for a UA server.
        /// </summary>
        /// <param name="server">The server displayed in the form.</param>
        /// <param name="configuration">The configuration used to initialize the server.</param>
        public void Initialize(StandardServer server, ApplicationConfiguration configuration)
        {
            m_server = server;
            m_configuration = configuration;

            m_dispatcherTimer = new DispatcherTimer();
            m_dispatcherTimer.Tick += UpdateTimerCTRL_Tick;
            m_dispatcherTimer.Interval = new TimeSpan(0, 0, 5); // tick every 5 seconds
            m_dispatcherTimer.Start();

            // add the urls to the drop down.
            UrlCB.Items.Clear();

            foreach (EndpointDescription endpoint in m_server.GetEndpoints())
            {
                if (!UrlCB.Items.Contains(endpoint.EndpointUrl))
                {
                    UrlCB.Items.Add(endpoint.EndpointUrl);
                }
            }

            if (UrlCB.Items.Count > 0)
            {
                UrlCB.SelectedIndex = 0;
            }
        }
All Usage Examples Of Opc.Ua.Server.StandardServer::GetEndpoints