Exemplo n.º 1
0
        List <TopicInfo> GetTopicInfos(string response)
        {
            XmlDocument soapRawResponse = BaseNotificationXmlUtils.GetRawResponse(response);

            // find Topic elements in "raw" packet
            string topicPath;

            topicPath = "/s:Envelope/s:Body/events:GetEventPropertiesResponse/t1:TopicSet";
            XmlNamespaceManager manager = CreateNamespaceManager(soapRawResponse);

            manager.AddNamespace("t1", "http://docs.oasis-open.org/wsn/t-1");

            XmlNode           topicSetNode    = soapRawResponse.SelectSingleNode(topicPath, manager);
            XmlElement        topicSetElement = topicSetNode as XmlElement;
            List <XmlElement> rootTopics      = new List <XmlElement>();

            foreach (XmlNode node in topicSetElement.ChildNodes)
            {
                XmlElement e = node as XmlElement;
                if (e != null)
                {
                    rootTopics.Add(e);
                }
            }

            // Check that the topic of interest is supported

            // select all topics
            List <XmlElement> topics = new List <XmlElement>();

            foreach (XmlElement element in rootTopics)
            {
                FindTopics(element, topics);
            }

            List <TopicInfo> topicInfos = new List <TopicInfo>();

            foreach (XmlElement topicElement in topics)
            {
                TopicInfo info = TopicInfo.ConstructTopicInfo(topicElement);
                topicInfos.Add(info);
            }

            return(topicInfos);
        }
 public static XmlDocument GetRawResponse(string response)
 {
     return(BaseNotificationXmlUtils.GetRawResponse(response));
 }