

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….
1 Guest(s)
