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: 1026
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: 1919

Currently Online:
16 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: 731

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

inilarythikibia, rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466

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

Administrators: admin: 1