Example #1
0
        /// <summary>
        /// Asynchronously calls the TranslateBrowsePathsToNodeIds service.
        /// </summary>
        public virtual IAsyncResult BeginTranslateBrowsePathsToNodeIds(TranslateBrowsePathsToNodeIdsMessage message, AsyncCallback callback, object callbackData)
        {
            try
            {
                // check for bad data.
                if (message == null) throw new ArgumentNullException("message");

                // set the request context.
                SetRequestContext(RequestEncoding.Xml);

                // create handler.
                ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);
                return result.BeginProcessRequest(SecureChannelContext.Current, message.TranslateBrowsePathsToNodeIdsRequest);
            }
            catch (Exception e)
            {
                throw CreateSoapFault(message.TranslateBrowsePathsToNodeIdsRequest, e);
            }
        }
Example #2
0
        /// <summary>
        /// The operation contract for the TranslateBrowsePathsToNodeIds service.
        /// </summary>
        public virtual TranslateBrowsePathsToNodeIdsResponseMessage TranslateBrowsePathsToNodeIds(TranslateBrowsePathsToNodeIdsMessage request)
        {
            TranslateBrowsePathsToNodeIdsResponse response = null;

            try
            {
                // OnRequestReceived(message.TranslateBrowsePathsToNodeIdsRequest);

                SetRequestContext(RequestEncoding.Xml);
                response = (TranslateBrowsePathsToNodeIdsResponse)TranslateBrowsePathsToNodeIds(request.TranslateBrowsePathsToNodeIdsRequest);
                // OnResponseSent(response);
                return new TranslateBrowsePathsToNodeIdsResponseMessage(response);
            }
            catch (Exception e)
            {
                Exception fault = CreateSoapFault(request.TranslateBrowsePathsToNodeIdsRequest, e);
                // OnResponseFaultSent(fault);
                throw fault;
            }
        }
Example #3
0
 /// <summary>
 /// The operation contract for the TranslateBrowsePathsToNodeIds service.
 /// </summary>
 public virtual TranslateBrowsePathsToNodeIdsResponseMessage TranslateBrowsePathsToNodeIds(TranslateBrowsePathsToNodeIdsMessage request)
 {
     try
     {
         SetRequestContext(RequestEncoding.Xml);
         TranslateBrowsePathsToNodeIdsResponse response = (TranslateBrowsePathsToNodeIdsResponse)TranslateBrowsePathsToNodeIds(request.TranslateBrowsePathsToNodeIdsRequest);
         return new TranslateBrowsePathsToNodeIdsResponseMessage(response);
     }
     catch (Exception e)
     {
         throw CreateSoapFault(request.TranslateBrowsePathsToNodeIdsRequest, e);
     }
 }
Example #4
0
        /// <summary>
        /// Returns the target nodes found by following a browse path from a starting node.
        /// </summary>
        public TranslateBrowsePathsToNodeIdsResponseMessage TranslateBrowsePathsToNodeIds(TranslateBrowsePathsToNodeIdsMessage request)
        {
            try
            {
                lock (m_lock)
                {
                    // verify that the session is still valid. 
                    VerifySession(request.RequestHeader, false);

                    // process each path being followed.
                    ListOfBrowsePathResult results = new ListOfBrowsePathResult();
                    ListOfDiagnosticInfo diagnosticInfos = new ListOfDiagnosticInfo();

                    for (int ii = 0; ii < request.BrowsePaths.Count; ii++)
                    {
                        BrowsePathResult result = new BrowsePathResult();
                        DiagnosticInfo diagnosticInfo = new DiagnosticInfo();

                        m_nodeManager.TranslateBrowsePath(
                            request.BrowsePaths[ii],
                            result,
                            diagnosticInfo);

                        results.Add(result);
                        diagnosticInfos.Add(diagnosticInfo);
                    }

                    // return the response.
                    TranslateBrowsePathsToNodeIdsResponseMessage response = new TranslateBrowsePathsToNodeIdsResponseMessage();

                    response.ResponseHeader = CreateResponseHeader(request.RequestHeader);
                    response.Results = results;
                    response.DiagnosticInfos = diagnosticInfos;

                    return response;
                }
            }
            catch (Exception e)
            {
                throw CreateSoapFault(request.RequestHeader, e);
            }
        }