22:47, EEST
February 21, 2014
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
15:31, EEST
April 3, 2012
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).
Most Users Ever Online: 1919
Currently Online:
74 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 739
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6453
Newest Members:
shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmonsModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1027, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1