Closed loliparra80 closed 3 years ago
Could you share the server with me so I can test this locally?
Hello, today I have tried my test application directly as a new project in your LibUA solution, with the LibUA reference directly from your LibUA project, and also ser the Token with "Anonymous" and now it's working.
var activateRes = client.ActivateSession(new UserIdentityAnonymousToken("Anonymous"), new[] { "en" });
Maybe the latest release in nuget package installer is not already updated, I don't know. Thank you.
I have a simple test console application from your samples:
`var appDesc = new ApplicationDescription( "urn:DemoApplication", "uri:DemoApplication", new LocalizedText("UA SDK client"), ApplicationType.Client, null, null, null); ApplicationDescription[] appDescs = null; EndpointDescription[] endpointDescs = null;
Client clientUA = new Client("127.0.0.1", 49320, 1000); clientUA.Connect(); clientUA.OpenSecureChannel(MessageSecurityMode.None, SecurityPolicy.None, null); clientUA.FindServers(out appDescs, new[] { "en" }); clientUA.GetEndpoints(out endpointDescs, new[] { "en" }); var createRes = clientUA.CreateSession(appDesc, "urn:DemoApplication", 120); clientUA.Disconnect(); `
But when try to make de CreateSession I had an Exception:
This is the server configuration, I had configured without security.
If I set the security with Basic256Sha256, then a get another error:
The code with security:
` var usernamePolicyDesc = endpointDescs .First(e => e.UserIdentityTokens.Any(t => t.TokenType == UserTokenType.UserName)) .UserIdentityTokens.First(t => t.TokenType == UserTokenType.UserName) .PolicyId;
`
Maybe you can understand better the error than me and suggest me another configuration o whatever.
Thank you.