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
How check if Endpoint is valid URI
June 22, 2021
17:16, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,

Is there a function in the sdk to check if an endpoint is a valid opc ua URI ?

Thanks

June 23, 2021
7:57, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

You can use UaAddress.validate(String address). It will throw a URISyntaxException if the address isn’t valid.

June 23, 2021
17:43, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,
Thank you for your reply;

So when try UaAddress.validate(“something”) it not throw a URISyntaxException.

Is there another function ?

Thanks

June 24, 2021
10:08, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

The UaAddress.validate method actually checks if a valid UaAddress could be parsed from a given String. For example, “something” can be parsed to “opc.tcp://something:4840”, which is a valid address. In a sense the method doesn’t actually validate whether or not the input String is a valid UaAddress, but whether or not the output of UaAddress.parse(String address) would be a valid UaAddress.

Is this method sufficient for your needs or would you need a method that takes a String as its input and determines without adding anything to it whether or not the String is a valid OPC UA URI?

June 24, 2021
11:21, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,

Yes i need a methode that takes a String as input and determines if this String is valid OPC UA URI.

June 24, 2021
13:27, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

We’re considering adding such validation method to the SDK in future. In the meantime, you can validate that the OPC UA URI contains the following parts:

1. The identifier of a TransportProtocol, e.g.g “opc.tcp” for OPC UA TCP, followed by”://”
2. Hostname or IP address of the Server
3. “:” followed by the number of the port used by the Server
4. “/” followed by the Server Name

For example, “opc.tcp://MyHostName:12345/OPCUA/MyServer” is a valid OPC UA URI.

Validating identifiers of transport protocols is tricky, since new ones can be added to the specification in future. Instead, I would just check that the identifier belongs to any of the TransportProtocols supported by your application, which are probably OPC UA TCP and/or OPC UA HTTPS since you’re using the Prosys OPC UA SDK for Java.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
20 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: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

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