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
Can we explicitly define the Endpoint url for OPC UA Server using Prosys OPCUA Java SDK?
November 27, 2019
13:15, EET
Avatar
anandhu
New Member
Members
Forum Posts: 1
Member Since:
November 27, 2019
sp_UserOfflineSmall Offline

I am a beginner to OPCUA. Iwas able to run the sampleConsoleServer in a remote server. I am able to acess it remotely using the IP address of the server. But the OPC Server is returning an endpoint that is defined based on the machine name. The hostname is actually different from the machine name and hence is a problem. If there is any way i can set the hostname of the endpoint in the code this issue would be solved..

ThanksEmbarassed

November 28, 2019
11:53, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

If I may ask why it is a problem? Generally speaking the hostname is the one you use to connect. If that doesn’t work, then your DNS settings should be checked so that it can resolve that.

Generally in practice the endpointUrl should not be used for the connection, unless you have nothing else. For examples connecting into a server behind NAT usually isn’t aware of the address translation (regardless of that the specification magically assumes this to be the case). But it should also be noted that the specification has NAT workaround such as that the Client should be able to deal with this (1.04 Part 12 Annex A), i.e. it might need to just use the initial connection address.

Additionally it should be noted that the EndpointUrl Hostname portion should be a hostname of the machine, therefore using the (to my knowledge) Windows-only “Machine name” is not an option. OPC UA (and Java) are platform-independent so I do not think using the Machine name would make sense (however, as long as your OS can convert that to suitable IP address, connecting with that should by itself work; note that “Machine name” only works within a LAN).

I would recommend making the Machine name and hostname the same. Alternatively you could add a second hostname that matches the machine name. Note that by default we will only get one hostname (the one ApplicationIdentity.getActualHostName() returns, and that is best-effort search). Additionally it should be noted that multiple hostnames-scenario is not that well tested, but should work. However you do need to pass the hostnames for certificate generation and add the extra ones to UaServer.addEndpointHost().

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
18 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: 736

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6450

Newest Members:

kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1