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
What is the correct form to disconnect a client e clear all subscription?
December 30, 2016
12:47, EET
Avatar
bfraga
Member
Members
Forum Posts: 3
Member Since:
December 30, 2016
sp_UserOfflineSmall Offline

I have a OPA UA client that reads data from a Kepserver. It seems that when I’m disconnecting the client the subscriptions are still active in the server.
I’ve done the following steps to disconnect:
1 – subscription.setPublishingEnabled(false);
2 – subscription.removeItems();
3 – uaClient.removeSubscription(subscription);
4 – uaClient.disconnect();
Also I have set:
uaClient.setKeepSubscriptions(false);

Do I have to do anything else? Is someting wrong?

December 30, 2016
13:24, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello Bruno,

Initially this sounds like a bug in the server application. Have you already contacted Kepware about the issue?

Actually you don’t need to call anything else than UaClient.disconnect(). In CloseSession service, there’s a parameter “deleteSubscriptions” which tells the server if the subscriptions associated with the session should be deleted. As you mentioned, you can change the behaviour with UaClient.setKeepSubscriptions method. The default operation in Java SDK is that the client will request server to delete subscriptions.

Also, calling uaClient.removeSubscription(subscription) should delete the mentioned subscription so this is clearly a bug if the server does not delete the subscription.

January 20, 2017
12:53, EET
Avatar
bfraga
Member
Members
Forum Posts: 3
Member Since:
December 30, 2016
sp_UserOfflineSmall Offline

Hello Heikki,

Sorry about the delay but I was waiting for a return from Kepware, this is what they find:

****************
I finally got a chance to talk to a developer about this. There are actually 2 issues.

1. The Close channel request needs to have a timestamp in it.
2. The close channel type should be set to CLO per the specification. Their client is setting it to MSG and since the close secure channel message is not an MSG type it is being rejected as an invalid service.

Note: they need to correct the time stamp issue as well because that will result in an invalid message format error when it gets processed.

I attached an image to the case which should help.
****************

Can you help me understand it? Is there somthing I can do when creating the client? Or is sometinhg in the UA client?

January 23, 2017
13:32, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi Bruno,

Thank you for the information.

As for the issue 2: This is a known issue in SDK versions 2.2.0 and earlier.

This was fixed in version 2.2.2. Please see the release notes at https://downloads.prosysopc.com/opcua/release_notes2.2.2-638.html . The line “Fixed (Github #2): CloseSecureChannelRequest should be sent with CLOF header” is this issue.

As for the issue 1: The Java SDK (or actually Java Stack) works how described. However, we are currently not aware that the Close Secure Channel request header should have a timestamp in it.

The OPC UA specification version 1.03, part 4, table 165 describes the RequestHeader timestamp as “The time the Client sent the request. The parameter is only used for diagnostic and logging purposes in the server.” So, based on that part of the specification, it’s not clear that setting this timestamp should be mandatory. Also, we haven’t received similar complaints from other vendors.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1