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
Not able to connect to Kepware server using prosys java sdk
April 29, 2015
3:07, EEST
Avatar
jvarma80
Member
Members
Forum Posts: 3
Member Since:
April 25, 2015
sp_UserOfflineSmall Offline

Hello Everyone,
I am using prosys java sdk to connect to a kepware server, fetch some data from the nodes and print it to the console. Taking a cue from the SampleConsoleClient.java and SimpleClient.java, I wrote a java client program to connect to a kepware server installed in a windows server. The program worked fine when I connected to the prosys simulated server and I got the server status successfully. But I am getting the following error when I am trying to connect to the Kepware server.
Exception in thread “main” com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://hostname:49320/Kepware.KEPServerEX.V5 ServiceResult=Bad_ConnectionRejected (0x80AC0000) “Could not establish a network connection to remote server.”

I am using the following code to connect to the kepware server.
UaClient client = new UaClient(
“opc.tcp://hostname:49320/Kepware.KEPServerEX.V5”);
client.setSecurityMode(SecurityMode.NONE);

In the initialize() method, I am defining the applicationUri and productUri as follows:
ApplicationDescription appDescription = new ApplicationDescription();
appDescription.setApplicationUri(“opc.tcp://hostname:49320/OPCUA/Kepware.KEPServerEX.V5:KepwareConnectionClient”);
appDescription.setProductUri(“urn:prosysopc.com:UA:KepwareConnectionClient”);
appDescription.setApplicationType(ApplicationType.Client);
final ApplicationIdentity identity = new ApplicationIdentity();
identity.setApplicationDescription(appDescription);
client.setApplicationIdentity(identity);

For some reason, I am getting the error which says ” com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://hostname:49320/Kepware.KEPServerEX.V5 ServiceResult=Bad_ConnectionRejected (0x80AC0000) “Could not establish a network connection to remote server.”
Not sure where I am going wrong. Is it the url that is wrong or is the applicationUri or the ProductUri have some errors in them.

Please help me in resolving this issue, Thanks in advance….

April 30, 2015
8:32, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

The error means that the server is now available in the address that you have defined in the UaClient constructor.

Please, do not modify the ApplicationDescription according to the server: it must represent your own application and is provided as information to the server application.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online: broessl
31 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