Ejemplo n.º 1
0
        public virtual QueryResults Poll(PollRequest request)
        {
            var queryParameters = request.parameters?.Select(x => new QueryParam {
                Name = x.Name, Values = x.Values
            });
            var results           = _queryPerformer.ExecutePollQuery(request.QueryName, queryParameters);
            var formattedResponse = _eventFormatter.Format(results);

            return(new QueryResults {
                QueryName = request.QueryName, EventList = new EventList {
                    Elements = formattedResponse
                }
            });
        }
Ejemplo n.º 2
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);
            }
        }