Hi!
I have used 2018.2 for long time.(Delphi) Now i have changed in 2019.2 (I need support for Windows 7 again).
i have function to read root in my opc ua server but in 2019.2 doesn't works anymore.... Give me certificate Problem.
My function:
var
BrowseParameters: _UABrowseParameters;
BrowsePathParser: _UABrowsePathParser;
Client: TEasyUAClient;
Count: Cardinal;
Element: OleVariant;
EndpointDescriptor: _UAEndpointDescriptor;
NodeDescriptor: _UANodeDescriptor;
NodeElement: _UANodeElement;
NodeElementEnumerator: IEnumVariant;
NodeElements: _UANodeElementCollection;
ReferencesNodeId: _UANodeId;
begin
Client:= TEasyUAClient.create(self);
ReferencesNodeId := CoUANodeId.Create;
ReferencesNodeId.StandardName := 'References';
EndpointDescriptor := CoUAEndpointDescriptor.Create;
EndpointDescriptor.UrlString := 'opc.tcp://127.0.0.1:49320/';
NodeDescriptor := CoUANodeDescriptor.Create;
NodeDescriptor.NodeId.StandardName := 'Objects';
BrowseParameters := CoUABrowseParameters.Create;
BrowseParameters.NodeClasses := UANodeClass_Object;
BrowseParameters.ReferenceTypeIds.Add(NodeDescriptor.NodeId);
BrowseParameters.ReferenceTypeIds.Add(ReferencesNodeId);
NodeElements := Client.BrowseDataNodes(
EndpointDescriptor.UrlString,
NodeDescriptor.NodeId.expandedText);
NodeElementEnumerator := NodeElements.GetEnumerator;
while (NodeElementEnumerator.Next(1, Element, Count) = S_OK) do
begin
NodeElement := IUnknown(Element) as _UANodeElement;
if Assigned(NodeElement) then
Showmessage(NodeElement.BrowseName.ToString);
end;
I have certificate problem (Check screenshot).
so i have add:
client.IsolatedParameters.SessionParameters.EndpointSelectionPolicy.
AllowedMessageSecurityModes := UAMessageSecurityModes_SecurityNone;
client.IsolatedParameters.SessionParameters.EndpointSelectionPolicy.AllowZeroSecurityLevel :=TRUE;
Clientconfiguration := TEasyUAClientConfiguration.Create(self);
ClientConfiguration.SharedParameters.EngineParameters.CertificateAcceptancePolicy.AcceptAnyCertificate := true;
ClientConfiguration.SharedParameters.EngineParameters.CertificateAcceptancePolicy.AllowUserAcceptCertificate := true;
// ClientConfiguration.SharedParameters.EngineParameters.CertificateAcceptancePolicy.TrustedEndpointUrlStrings := (ANode.NODE.DataObject as TInfo).EndPoint);
Clientconfiguration.Connect;
But i have same problem