How to modify the EndpointUrl after calling getEndpoints

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
stanleylee
Full Member
Full Member
Posts: 6
Joined: 11 Dec 2017, 08:33

How to modify the EndpointUrl after calling getEndpoints

Post by stanleylee »

Hi all,

I want to modify the URL in endpointDescriptions after calling getEndpoints().

I knew how to get the URL from the source code shown below.
==============================
UaString sTemp;
sTemp = &endpointDescriptions[k].EndpointUrl;
printf(" Endpoint URL %s\n", sTemp.toUtf8());
...
...
==============================

Could anyone tell me how to modify the URL of endpointDescriptions[k].ApplicationUri and endpointDescriptions[k].EndpointUrl?

Thank you.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3137
Joined: 18 Mar 2011, 15:09

Re: How to modify the EndpointUrl after calling getEndpoints

Post by Support Team »

Hi,

in most cases changing the EndpoinURL is not a good idea, because it requires other changes alongside with it (e.g. in the certificate). Recreating the certificates may lead to issues with other applications already having trusted the original one.
Best regards
Unified Automation Support Team

stanleylee
Full Member
Full Member
Posts: 6
Joined: 11 Dec 2017, 08:33

Re: How to modify the EndpointUrl after calling getEndpoints

Post by stanleylee »

Is it possible to modify the demo codes of client_cpp_sdk to replace the hostname that is the same as UaExpert?

https://www.dropbox.com/scl/fi/qiifzk13b1t2gtwa2qd4s/2024-06-13_11h39_48.png?rlkey=0pu8ov08vngi9wvvqotbb8fe4&dl=0

stanleylee
Full Member
Full Member
Posts: 6
Joined: 11 Dec 2017, 08:33

Re: How to modify the EndpointUrl after calling getEndpoints

Post by stanleylee »

Is it possible to modify the demo codes of client_cpp_sdk to replace the hostname that is the same as UaExpert?

https://www.dropbox.com/scl/fi/qiifzk13b1t2gtwa2qd4s/2024-06-13_11h39_48.png?rlkey=0pu8ov08vngi9wvvqotbb8fe4&dl=0

User avatar
Support Team
Hero Member
Hero Member
Posts: 3137
Joined: 18 Mar 2011, 15:09

Re: How to modify the EndpointUrl after calling getEndpoints

Post by Support Team »

Hi,

no that is not the intended way of using the Client SDK. Each OPC UA application must have a (unique) ApplicationURL and ProductURL (typically hard coded). The hostname is part of the endpointURL of a particular instance of such application (running on a certain host computer), other applications may generate a unique GUID into their instance identification. For this "application instance" a self signed certificate is created which is unique for this application running on one host, hence allows check and verify its origin.

Therefor it makes absolutely no sense to highjack, copy or manipulate some other application's identification criteria.
Best regards
Unified Automation Support Team

Post Reply