Activate Session error when connecting to OPC UA server

Questions regarding the use of the ANSI C SDK for Server or Client development or integration into customer products ...

Moderator: uasdkc

Post Reply
dbirman
Jr. Member
Jr. Member
Posts: 3
Joined: 12 Oct 2017, 19:16

Activate Session error when connecting to OPC UA server

Post by dbirman »

Currently I have a OPC UA server listening on an endpoint like this opc.tcp://localhost:4980. And when I attempt to connect to it from a different host o n the same lan using the ANSI C SDK. In the connection callback i get an error with this data.

ServiceType: ActivateSession

Error: 0x80200000(BadIdentityTokenInvalid)

ClientSideError: false

The clients that connect to this server use the ip addressed assigned to it on the lan i.e (192.168.1.10). So the clients use an endpoing url that looks like this opc.tcp://192.168.1.10:4980

But when I connected using the win32 SDK on another host on the same lan. there is no issue connecting and it is successful. Must I change the endpoint url on the server to "opc.tcp://192.168.1.10:4980" ? Any insight would be greatly appreciated.

NOTE: the server has no certs and the clients are connecting using no certs and anonymous setting.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Activate Session error when connecting to OPC UA server

Post by Support Team »

Hello dbirman,

there should not be any difference in connecting to localhost or IP address regarding the user identity tokens. What kind of server are you trying to connect to?

Please ensure that the server supports the anonymous user token. Please also ensure that your client is set to use the anonymous user token. If this doesn't help, please enable the server trace if possible to check what exactly it considers wrong about the client's user token.
Best regards
Unified Automation Support Team

dbirman
Jr. Member
Jr. Member
Posts: 3
Joined: 12 Oct 2017, 19:16

Re: Activate Session error when connecting to OPC UA server

Post by dbirman »

In the Ua C SDK from what I see in wireshark is that i am connecting with a anon token with no cert policy. I shall get my hands on the server log and see what the issue may be, but it is the server rejecting the token?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Activate Session error when connecting to OPC UA server

Post by Support Team »

Hello dbirman,

the ClientSideError is set to false in the callback, this means that the error is being sent from the server. Please ensure that the server supports the anonymous user token.
Best regards
Unified Automation Support Team

Post Reply