.NET Based OPC UA Client/Server SDK  3.1.0.500
Discovery – Get Endpoints

Table of Contents

Description

The following dialog shows an example implementation of the method Get Endpoints. It can be used to fetch all endpoints supported by the server. Press the button “Show Code” to display the corresponding code, and the button “Help” to show this documentation page.

clienttutorials_get_endpoints.png

Enter the endpoint URL into the input field at “Server URL” an press the button “Get Endpoints”. Then all discovered endpoints will be listed in the table at “Get Endpoints Response”. Check the box in front of “Use Asynchronous Pattern” to call “BeginGetEndpoints” instead of “GetEndpoints”.

Sample Code

The following code fetches all supported endpoints of a given server and displays the response in a list.

First an instance of the Discovery class is created. This class provides helper functionality for getting the endpoints. After retrieving the discovery url from the GUI, we can call GetEndpoints.

List<EndpointDescription> endpoints;
// create the object used to find servers or endpoints.
using (Discovery discovery = new Discovery(m_parent.Application))
{
// get the discoverUrl from the gui
string discoveryUrl = ServerUrlTB.Text;
// look for the LDS with the default endpoint.
endpoints = discovery.GetEndpoints(discoveryUrl);
}