3:07, EEST
April 25, 2015
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….
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, DonaldPoomaModerators: 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