Greetings, I am working on a project where i have to have the OPC UA Client inside OPC UA Server.
OPC UA Server shall use its own OPC UA Client (discovery) to get the Endpoints and establish the session with respective server via OPC UA Client.
My OPC UA Server is Console Application - no issues working fine.
OPC UA Client - created as a Class library and i have create a unique ApplicationInstance with its own Application configuration settings.
- ApplicationInstance is created and loaded
- Able to start the Application Instance.
I have used the application instance to create the Discovery Server. Then used the discovery to get the Endpoints for the requested server.I have used Unified Automation UA Demo Server for testing.
When I query the Endpoints using the Discovery Server, i am not getting response instead below exception has been thrown. But the same server endpoints I am able to query via UAExpert also in other OPC UA Clients.
Can you help me what went wrong with program flow?[AggregateException] One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at UnifiedAutomation.UaBase.DefaultTransportChannel.EndSendRequest(IAsyncResult result)
at UnifiedAutomation.UaBase.DiscoveryClient.EndGetEndpoints(IAsyncResult result, EndpointDescriptionCollection& endpoints)
at UnifiedAutomation.UaClient.Discovery.OnGetEndpointsComplete(IAsyncResult result)
[SocketException] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [fe80::5cb0:a98:5520:9552%14]:48030
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UnifiedAutomation.UaBase.TapTcpListener.<ConnectAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UnifiedAutomation.UaBase.DefaultTransportChannel.<OpenChannelAsync>d__55.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UnifiedAutomation.UaBase.DefaultTransportChannel.<SendRequestAsync>d__56.MoveNext()
Query: is it not possible to create the OPC UA Client as a Class Library?