Opc.Ua.Server.StandardServer.TranslateBrowsePathsToNodeIds C# (CSharp) Method

TranslateBrowsePathsToNodeIds() public method

Invokes the TranslateBrowsePathsToNodeIds service.
public TranslateBrowsePathsToNodeIds ( RequestHeader requestHeader, BrowsePathCollection browsePaths, BrowsePathResultCollection &results, DiagnosticInfoCollection &diagnosticInfos ) : ResponseHeader
requestHeader RequestHeader The request header.
browsePaths BrowsePathCollection The list of browse paths for which NodeIds are being requested.
results BrowsePathResultCollection The list of results for the list of browse paths.
diagnosticInfos DiagnosticInfoCollection The diagnostic information for the results.
return ResponseHeader
        public override ResponseHeader TranslateBrowsePathsToNodeIds(
            RequestHeader                  requestHeader, 
            BrowsePathCollection           browsePaths, 
            out BrowsePathResultCollection results, 
            out DiagnosticInfoCollection   diagnosticInfos)
        {
            results = null;
            diagnosticInfos = null;

            OperationContext context = ValidateRequest(requestHeader, RequestType.TranslateBrowsePathsToNodeIds);

            try
            {
                if (browsePaths == null || browsePaths.Count == 0)
                {
                    throw new ServiceResultException(StatusCodes.BadNothingToDo);
                }

                m_serverInternal.NodeManager.TranslateBrowsePathsToNodeIds(
                    context,
                    browsePaths,
                    out results,
                    out diagnosticInfos);

                return CreateResponse(requestHeader, context.StringTable);  
            }
            catch (ServiceResultException e)
            {
                lock (ServerInternal.DiagnosticsLock)
                {
                    ServerInternal.ServerDiagnostics.RejectedRequestsCount++;

                    if (IsSecurityError(e.StatusCode))
                    {
                        ServerInternal.ServerDiagnostics.SecurityRejectedRequestsCount++;
                    }
                }

                throw TranslateException(context, e);
            }  
            finally
            {
                OnRequestComplete(context);
            } 
        }