Endpoint Selection is wrong when URLs differ

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
MartinLentzsch
Jr. Member
Jr. Member
Posts: 4
Joined: 24 Jan 2017, 16:20

Endpoint Selection is wrong when URLs differ

Post by MartinLentzsch »

Hello,

I have one problem with the .Net UA Client.
My Customer uses a special configuration for his OPC servers.
He has an OPC server in his machine connected in an internal LAN with network 172.30... Unfortunately the available endpoint URLs contains the IP address.
They have a second OPC server internally connected in their internal network wich is reachable via a different port.
The external network is connected via an internal router with IP adresses 10.33....
Next thing is, both OPC servers support differnt settings for security. None and Basic256.
T get access I have to set the URL for Session.Connect to the outside IP address(10.32...). The endpoints I get back are with the internal IP.

First I tried to connect without security.
When I try to get access to the first OPC server it works. When I try to connect to the second OPC server in this machine it does not work.
With ttracing switched on I found out that during the connect process the UA Client sets the endpoint to the default endpoint. On both servers.
I found out too, the order of the endpoints I get back with discovery is different. On the one OPC server I get the unsecure endpoint first. This one grants access. The second on gives me the secure endpoint first. And this will not work without security settings.

All tries with activated security failed with the message 'Could not send an Open Secure Channel request'

When I try to get connection with the UA Export tool I have no problems.

I know that I do not have support currently, but the same happens with the current version of the components. So it only makes sense to me to upgrade my subscription when the failure is fixed.

Thank you
best regards
Martin Lentzsch

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

Re: Endpoint Selection is wrong when URLs differ

Post by Support Team »

Hello Martin,

the .NET SDK has two connection mechanizms the "simple" connect (let the SDK select the best option available, including highest security policy), on the other hand the "advanced" connect where you need to do the GetEndpoints yourself and implement logic (most applications would display and let user select) to pick and choose from the returned endpoints yourself.

Depending on the server implementation the server will return "all" Endpointkonfigurations independently via which IP Address the "GetEndpoint" request came in. However, typically the requesting Client will be able to connect only to the Endpoints that are in same network Only exception: the Client as well has multiple network cards and is operating in different subnets and "discovers" the server via one network address and later connects via a different network.

There are event handlers wher you can hook into the connection establishment in order to modify/update the Endpoint you are going to use. i) "use DNS name and port form discovery" and ii) updateEndpoint event handler
https://documentation.unified-automatio ... mple5.html
Best regards
Unified Automation Support Team

Post Reply