issue with connecting to dataFEED

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

Moderator: uasdkc

Post Reply
florian.
Jr. Member
Jr. Member
Posts: 2
Joined: 02 Mar 2017, 11:24

issue with connecting to dataFEED

Post by florian. »

Hi,

for a few days i am trying to connect the getting_started lesson01 client with a dataFEED OPC UA server and it does not work.
The code itself works fine but an error occurs every time i try to connect. Obviously i changed the endpointurl and checked that the usertokentype is OpcUa_UserTokenType_Anonymous.

Code: Select all

UA Client: Connecting to opc.tcp://localhost:48050 ...

--> Sample_ConnectionStatusChanged_CB: Connecting

Sample_ConnectionError_CB:
     ServiceType: ActivateSession
     Error: 0x80200000
     CliendSideError: false
An error occurred. Terminating now.
An error occurred. Terminating now.

--> Sample_connectionStatusChanged:CB: Disconnected

UA Client: Main stopped
The adress of the dataFEED Server is "opc.tcp://localhost:48050/" and although i do not use the discovery this address is "opc.tcp://localhost:4840". The security configuration is only set to None and the Authentication Setting is just set to Anonymous policy. The server and the client are on the same machine.

As a test i tried to connect to the UAGateway with completely the same configuration and then the communication works fine with no error.
Therefore i used Wireshark to compare the traffic. The last working message ist the ActivateSessionRequest from client to server before a ServiceFault arises. Compared to the working connection, the message - for me - seams to be the same. Therefore i used two computer and changed die IP of the url.

By using the demo_client a connection to the fixed url does not work as well. If i try to connect by using the discovery i am able to connect to the dataFEED server with no security policy.
While debugging i could not find any difference between the settings of the lesson01 client and the demo client of unified automation.

Thanks for some hints.

Florian
---
I use VisualStudio 2010 on Windows7 and the firewall is not active.

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

Re: issue with connecting to dataFEED

Post by Support Team »

Hello Florian,

thank you for reporting this issue. The reason for this behaviour is as follows:

1. The AnsiC Client SDK tries to get the appropriate PolicyId for the anonymous user token from your configured UaClient_Session::EndpointDescription::UserIdentityTokens. If you don't have any user tokens configured, the SDK will not set any PolicyId in ActivateSession. We know about this issue and will fix it in an upcoming version of the SDK.

2. The Softing UA Server expects the PolicyId of anonymous user tokens to be set correctly in ActivateSession and returns an error if this is not the case. Our UA servers ignore the PolicyId of anonymous user tokens, as it is not necessary to distinguish different anonymous user tokens.

For being able to connect, you should call GetEndpoints on the server before connecting. After GetEndpoint has succeeded, you copy the desired OpcUa_EndpointDescription to UaClient_Session::EndpointDescription, so the list of user tokens is what the server actually provides. This allows the SDK to set the expected PolicyId in the ActivateSession request. For an example, please refer to the uaclientc example delivered with the SDK.
Best regards
Unified Automation Support Team

Post Reply