When an OPC Studio product establishes a connection to an OPC UA server, it tries to do so in most effective manner. When necessary, it first calls the GetEndpoints service of the target OPC UA server, and pre-selects the endpoint. In other cases, the call to GetEndpoints can be skipped, and the endpoint is synthesized by OPC Studio components.
The endpoint demands preselection if at least of one the conditions below is fulfilled:
This might seem quite complicated, but it boils down to a simple rule: If a product based on OPC Studio has information available that is precise enough to allow connection without calling GetEndpoints first, it will connect straight away. Otherwise, it will call GetEndpoints in order to obtain the list of available endpoints and select from them (= endpoint preselection).
In addition, the endpoint will be preselected if you set the AlwaysPreselectEndpoint Property to true.
Endpoint preselection is performed by calling the OPC UA GetEndpoints service on the target server, and applying the effective endpoint selection policy to it. The OPC UA server must therefore properly support the GetEndpoints service for endpoint preselection to work. When applying the endpoint selection policy yields an endpoint, the parameters of it are then used to create the OPC UA secure channel.
Synthesized endpoints do not require use of the OPC UA GetEndpoints service as part of the connection process. They are therefore a bit faster to connect, and (more importantly) allow connections even to servers that do not support the GetEndpoints service (or do not support it properly). The client code in OPC Studio products simply uses the parameters from the effective endpoint selection policy when creating the OPC UA secure channel. The effective endpoint selection policy is then applied to the endpoints returned by the OPC UA server from the CreateSession service, and OPC Data Client checks whether the endpoint specified by the policy is available.
In most cases, for the synthesized endpoint to work, you will need to specify the user token policy Id, in the UserTokenPolicyId Property. The user token policy Ids are server-specific (for example, servers based on OPC Foundation OPC UA .NET stack use a string form of integers, starting from "0" upwards).