I am trying to run this code from QuickOpcCSharpExamples:
// Instantiate the client object
var easyUAClient = new EasyUAClient();
// Obtain nodes under "Server" node
UANodeElementCollection nodeElementCollection = easyUAClient.BrowseNodes(
"http://opcua.demo-this.com:51211/UA/SampleServer", // or "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
UAObjectIds.Server,
new UABrowseParameters(UANodeClass.All, new [] { UAReferenceTypeIds.References } ));
I am getting the following exceptions:
Exception thrown: 'System.ServiceModel.FaultException' in System.ServiceModel.dll
Additional information: The message could not be processed. This is most likely because the action 'opcfoundation.org/UA/2008/02/Services.wsdl/InvokeService' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.
Exception thrown: 'OpcLabs.EasyOpc.UA.OperationModel.UAException' in OpcLabs.EasyOpcUA.dll
Additional information: An OPC-UA operation failure with error code -1 (0xFFFFFFFF) occurred, originating from ''. The inner exception, of type 'OpcLabs.EasyOpc.UA.Engine.UAClientEngineException', contains details about the problem.
Timeout connecting the OPC-UA client session. The total timeout value was 60000 milliseconds, and we have waited for 60000 milliseconds. The actual waiting time is lower than the total timeout (or even zero) if the connection operation has already started earlier.
(I seem to be getting similar exceptions for other UA samples in UADocExamples other than _EasyUAClient.BrowseNodes.Main.)
What am I doing wrong?
Thanks!