Ejemplo n.º 1
0
 public string[] GetSubscriptionIDs()
 {
     try
     {
         return(_subscriptionManager.List().ToArray());
     }
     catch (Exception ex)
     {
         throw EpcisFault.Create(ex);
     }
 }
Ejemplo n.º 2
0
 public virtual string[] GetSubscriptionIDs()
 {
     try
     {
         return(_subscriptionManager.ListAllSubscriptions().Select(x => x.Name).ToArray());
     }
     catch (EpcisException ex)
     {
         throw EpcisFault.Create(ex);
     }
 }
Ejemplo n.º 3
0
 public virtual void Unsubscribe(string name)
 {
     try
     {
         //TODO: remove subscription
     }
     catch (EpcisException ex)
     {
         throw EpcisFault.Create(ex);
     }
 }
Ejemplo n.º 4
0
 public virtual string[] GetQueryNames()
 {
     try
     {
         return(_queryManager.ListQueryNames().ToArray());
     }
     catch (EpcisException ex)
     {
         throw EpcisFault.Create(ex);
     }
 }
Ejemplo n.º 5
0
 public void Unsubscribe(string name)
 {
     try
     {
         _subscriptionManager.Delete(name);
     }
     catch (Exception ex)
     {
         throw EpcisFault.Create(ex);
     }
 }
Ejemplo n.º 6
0
 public string[] GetQueryNames()
 {
     try
     {
         return(_eventQuery.ListQueryNames());
     }
     catch (Exception ex)
     {
         throw EpcisFault.Create(ex);
     }
 }
Ejemplo n.º 7
0
        public void Subscribe(Message request)
        {
            try
            {
                var subscription = SubscriptionRequest.Parse(XElement.Parse(request.GetReaderAtBodyContents().ReadOuterXml()));

                _subscriptionManager.Add(subscription);
            }
            catch (Exception ex)
            {
                throw EpcisFault.Create(ex);
            }
        }
Ejemplo n.º 8
0
        public virtual void Subscribe(Message request)
        {
            try
            {
                var subscription = SubscriptionRequest.Parse(XElement.Parse(request.GetReaderAtBodyContents().ReadOuterXml()));

                //TODO: store subscription
                //_subscriptionManager.Subscribe(subscription);
            }
            catch (EpcisException ex)
            {
                throw EpcisFault.Create(ex);
            }
        }
Ejemplo n.º 9
0
        public Message Poll(Message request)
        {
            try
            {
                var pollRequest = PollRequest.Parse(XElement.Parse(request.GetReaderAtBodyContents().ReadOuterXml()));
                var results     = _eventQuery.Execute(pollRequest.Name, pollRequest.Parameters);

                return(MessageResponse.CreatePollResponse(results.Root));
            }
            catch (Exception ex)
            {
                throw EpcisFault.Create(ex);
            }
        }
Ejemplo n.º 10
0
        public virtual CaptureResponse Capture()
        {
            try
            {
                var request  = OperationContext.Current.RequestContext.RequestMessage.ToString() ?? "";
                var document = XDocument.Parse(request);
                var response = _eventCapturer.Capture(document);

                return(response);
            }
            catch (Exception ex)
            {
                throw EpcisFault.Create(ex);
            }
        }
Ejemplo n.º 11
0
        public virtual Message Poll(Message request)
        {
            try
            {
                var pollRequest       = PollRequest.Parse(XElement.Parse(request.GetReaderAtBodyContents().ReadOuterXml()));
                var results           = _queryPerformer.ExecutePollQuery(pollRequest.Name, pollRequest.Parameters);
                var formattedResponse = _responseFormatter.FormatPollResponse(pollRequest.Name, results);

                return(MessageResponse.CreatePollResponse(formattedResponse.Root));
            }
            catch (EpcisException ex)
            {
                throw EpcisFault.Create(ex);
            }
        }
Ejemplo n.º 12
0
        public string Capture()
        {
            try
            {
                var message  = OperationContext.Current.RequestContext.RequestMessage.ToString() ?? "";
                var document = XDocument.Parse(message);

                _xmlDocumentProcessor.Capture(document);

                return("OK");
            }
            catch (Exception ex)
            {
                throw EpcisFault.Create(ex);
            }
        }