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: 1919
Currently Online:
15 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: 738
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6451
Newest Members:
jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettingerModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1