Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Discrepancy between GetEndpoints and CreateSession endpoints
May 23, 2020
22:47, EET
Avatar
hbrackel
Member
Members
Forum Posts: 103
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Good evening,

An OPC UA client from a different manufacturer‘s SDK connects to a custom Prosys SDK (v4.1.x) based server. Client and server are running on the same machine. When the client issues a GetEndpoints service call with the url using an IP address (say 192.168.x.x), the server returns 4 endpoints (url in 4 security mode variants).
During the CreateSession service call on the same url using one of the 4 previous endpoints, the server provides 12 endpoints (IP address, 127.0.0.1, hostname times 4 security modes). The client then rejects the connection as, according to the spec, CreateSession has to provide the same endpoints as GetEndpoints.

Is there anything one could do in the server side code to rectify this behavior?

Thanks,
Hans-Uwe

May 25, 2020
15:31, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 579
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Uh oh. Basically the issue is sort of known and quite old (but with 4.x this should be easier fix due to no longer technically having “a gap” so to say between stack and SDK layers; just “SDK” as of 4.0.0). If possible, can you check that does it work properly when the hostname is used for connecting? If yes, then it should be the one we know of (i.e. it only works when hostname is used). Also if yes, how big of a problem it not working otherwise is?

That being said, if we are 1:1 looking at the spec, I would interpret that the number does not need to be the same, just sort of that the “CreateSession EndpointDescriptions” must contain the set of “GetEndpoint EndpointDescriptions”. It is also possible that we have misunderstood something there. Also it should be noted that some fields of the EndpointDescription are set to null when returned in CreateSession, thus you cannot “equals-compare” them directly. The relevant part in https://reference.opcfoundation.org/v104/Core/docs/Part4/5.6.2/#5.6.2.1 and below:


The Server returns its EndpointDescriptions in the response. Clients use this information to determine whether the list of EndpointDescriptions returned from the DiscoveryEndpoint matches the Endpoints that the Server has. If there is a difference then the Client shall close the Session and report an error. The Server returns all EndpointDescriptions for the serverUri specified by the Client in the request. The Client only verifies EndpointDescriptions with a transportProfileUri that matches the profileUri specified in the original GetEndpoints request

IF you feel adventurous you can try with
1. Subtype UaServer
2. Override UaServer.createSessionServiceHandler, return a subtyped SessionServiceHandler (pass protected UaServer.sessionManager field to super constructor, or do similar kind of subtyping for it)
3. Override method “protected void validateResponse(ServiceRequest request, ServiceResponse response, ServiceContext serviceContext)” within the subtyped SessionServiceHandler and check with instanceof and casts and edit the endpoints in the response object before they are sent to the client.

OR

A. Same as above 1.
B. Similar to 2. but Subtype SessionManager here instead.
C. Override SessionManager.getEndpoints() and modify the returned EndpointDescriptions.

I hope we can look this at some point near the future (probably sooner if it causes an actual problem that cannot be workarounded).

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 103

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 38

Rainer Versteeg: 32

Thomas Reuther: 31

Member Stats:

Guest Posters: 0

Members: 1160

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1048

Posts: 4416

Newest Members:

jonas.rahm, sophiekohler, zqecortney, adeletoscano947, forestgenders23, auroratrumper, ericmclain04, rblu, starlowery23194, dakotadalgety82

Moderators: Jouni Aro: 853, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 579, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Teppo Uimonen: 21, Markus Johansson: 24, Matti Siponen: 72, Lusetti: 0

Administrators: admin: 1