Inheritance: IServiceMessage
示例#1
0
        /// <summary>
        /// Asynchronously calls the Browse service.
        /// </summary>
        public virtual IAsyncResult BeginBrowse(BrowseMessage 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.BrowseRequest);
            }
            catch (Exception e)
            {
                throw CreateSoapFault(message.BrowseRequest, e);
            }
        }
示例#2
0
        /// <summary>
        /// The operation contract for the Browse service.
        /// </summary>
        public virtual BrowseResponseMessage Browse(BrowseMessage request)
        {
            BrowseResponse response = null;

            try
            {
                // OnRequestReceived(message.BrowseRequest);

                SetRequestContext(RequestEncoding.Xml);
                response = (BrowseResponse)Browse(request.BrowseRequest);
                // OnResponseSent(response);
                return new BrowseResponseMessage(response);
            }
            catch (Exception e)
            {
                Exception fault = CreateSoapFault(request.BrowseRequest, e);
                // OnResponseFaultSent(fault);
                throw fault;
            }
        }
示例#3
0
 /// <summary>
 /// The operation contract for the Browse service.
 /// </summary>
 public virtual BrowseResponseMessage Browse(BrowseMessage request)
 {
     try
     {
         SetRequestContext(RequestEncoding.Xml);
         BrowseResponse response = (BrowseResponse)Browse(request.BrowseRequest);
         return new BrowseResponseMessage(response);
     }
     catch (Exception e)
     {
         throw CreateSoapFault(request.BrowseRequest, e);
     }
 }
示例#4
0
        /// <summary>
        /// Returns the references that meet the filter criteria for one or more nodes.
        /// </summary>
        public BrowseResponseMessage Browse(BrowseMessage request)
        {
            try
            {
                lock (m_lock)
                {
                    // verify the session.
                    VerifySession(request.RequestHeader, false);

                    // process each node being browsed.
                    ListOfBrowseResult results = new ListOfBrowseResult();
                    ListOfDiagnosticInfo diagnosticInfos = new ListOfDiagnosticInfo();

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

                        m_nodeManager.Browse(
                            request.NodesToBrowse[ii],
                            result,
                            diagnosticInfo);

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

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

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

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