This QuickOPC service allows management of OPC UA client application. The OPC UA Client Application Service has high-level properties and methods for tasks related to maintaining application registrations in the GDS servers, obtaining instance certificate from GDS, refreshing application trust lists from GDS, and similar tasks.
If you can, prefer use of the OPC UA Client Application Service over implementing the same functionality yourself, e.g. with the help of OPC UA Global Discovery Client and/or OPC UA Certificate Management Client. The OPC UA Client Application Service already has all the necessary logic needed to perform the typical client-side application tasks properly and easily.
Specifically, methods in this service that work with the Global Discovery Server (GDS) are not licensed for use in lower editions of QuickOPC.
In order to export the registration data of the OPC UA application into an XML file, call the ExportRegisteredApplication Method. This method exports the security settings in the format used by the GDS client from OPC Foundation (Windows desktop sample). It uses the RegisteredApplication schema (which is not part of the OPC UA standard).
In order to export the security settings of the OPC UA application into an XML file, call the ExportSecuredApplication Method. This method exports the security settings in the format described in OPC UA Specification Part 6, Annex "Security settings management". The file conforms to the SecuredApplication schema.
The OPC UA Client Application Service is capable of maintaining client application registrations with one or more GDS servers simultaneously. The methods described further below allow you to control these registrations.
The service keeps track of the registrations (and unregistrations) performed. You can use the ApplicationIdDictionary Property to figure out the application IDs assigned to the current client application by the OPC UA Global Discovery Servers.
In order to register the current client application with the OPC UA Global Discovery Server (GDS), call the RegisterToGds Method. This method creates an application registration in the GDS, assigning it a new application ID. Existing registrations with the same application URI are removed first.
The difference between the RegisterToGds and UpdateGdsRegistration methods is that the RegisterToGds Method always obtains a new application ID, whereas the UpdateGdsRegistration Method attempts to reuse the existing application ID, if known. Neither of these methods requires the GDS registration be in any particular state for it to succeed, and both methods assure that after a successful execution, there is one and only one registration in the given GDS for this application.
The identity of the application itself is carried by its application URI, as given by the ApplicationUriString returned by the GetApplicationElement Method. Methods on this interface that manipulate or inspect the GDS registration use the application URI to identify the registration records belonging to this application.
For ane example to this method, see: Examples - OPC UA Application - Register to GDS.
In order to update the registration of the current client application within the OPC UA Global Discovery Server (GDS), call the UpdateGdsRegistration Method. This method updates an application registration in the GDS, keeping its application ID. A new registration is created if the application is not yet registered in the GDS. Preexisting registrations with the same application URI are removed.
The difference between the RegisterToGds and UpdateGdsRegistration methods is that the RegisterToGds Method always obtains a new application ID, whereas the UpdateGdsRegistration Method attempts to reuse the existing application ID, if known. Neither of these methods requires the GDS registration be in any particular state for it to succeed, and both methods assure that after a successful execution, there is one and only one registration in the given GDS for this application.
The identity of the application itself is carried by its application URI, as given by the ApplicationUriString returned by the GetApplicationElement Method. Methods on this interface that manipulate or inspect the GDS registration use the application URI to identify the registration records belonging to this application.
In order to remove the registration of the current client application from the OPC UA Global DIscovery Server (GDS), call the UnregisterFromGds Method. All existing registrations for the application URI are removed.
This method does not return an error or throw an exception if the application is not currently registered in the GDS.
In order to find all registrations for the current client application (using its application URI) in the OPC UA Global Discovery Server (GDS), call the FindGdsRegistrations Method. The method returns a dictionary of UAApplicationElement objects with application registration information, keyed by a UANodeId which is the application ID identifying the registration in the GDS.
The identity of the application itself is carried by its application URI, as given by the ApplicationUriString returned by the GetApplicationElement Method. Methods on this interface that manipulate or inspect the GDS registration use the application URI to identify the registration records belonging to this application.
For ane example to this method, see: Examples - OPC UA Application - Find all our registrations in GDS.
"Application element" is a data structure that contains registration information about an OPC UA application, i.e. how the application is configured to register itself in OPC UA ecosystem. In order to get the registration information for the current client application, call the GetApplicationElement Method.
The data contained the application element is implementation-dependent. For the OPC UA client application service on the EasyUAClient Class implemented with the OPC Foundation's UA SDK, it is determined by the settings in the UAApplicationManifest Class. In order to modify these parameters, access the ApplicationManifest Property of ApplicationParameters Property of EngineParameters Property of static SharedParameters Property.
For ane example to this method, see: Examples - OPC UA Application - Get registration information.
Some methods in this group work with the OPC UA Global Discovery Server (GDS) in the role of Certificate Manager (CM). Use of the certificate manager can significantly simplify the management of OPC UA security. Only use these methods if your OPC UA setup includes such Global Discovery Server.
In order to begin an asynchronous operation that obtains a enw application instance certificate from the certificate manager and stores it for subsequent usage, call the BeginObtainNewCertificate Method.
The operation is asynchronous, because it involves multiple steps, and waiting for a finalization of the request by the GDS (see the IEasyUACertificateManagementClient.FinishRequest method). End of the operation is handled by the IEasyUAClientApplication.EndObtainNewCertificate method. The operation can be cancelled using the IEasyUAClientApplication.CancelObtainNewCertificate method.
For a synchronous alternative, see the ObtainNewCertificate Extension Method, with its overloads.
For a task-based asynchronous programming pattern alternative, see the ObtainNewCertificateAsync Extension Method, with its overloads.
This method can also be provided a callback, in form of the IProgress Interface, through which it reports its progress.
In order to retrieve the current trust lists for the application from the certificate manager, and refresh own certificate stores accordingly, call the RefreshTrustLists Method.
The operation first updates the application's registration in the GDS, before retrieving the trust lists from the certificate manager and adding them to the certificate stores
In order to get the instance certificate the application is currently configured to use, call the GetInstanceCertificate Method.
The method returns the instance certificate, if found. It returns null if the instance certificate cannot be found.
In order to get the the subject distinguished name the application is configured to use for its certificates, call the GetCertificateSubjectName Method.
The value returned is implementation-dependent. For the OPC UA client application service on the EasyUAClient Class implemented with the OPC Foundation's UA SDK, it is determined by the settings in the UAClientServerApplicationParameters Class, as described here: Providing OPC UA Client Instance Certificate,
For ane example to this method, see: Examples - OPC UA Application - Get certificate subject name .