internal StepType PMSPullMessagesTest(out System.DateTime target, out NotificationMessageHolderType[] NotificationMessage, out System.DateTime TerminationTime, out SoapException ex, out int timeOut, out bool timeOutSpec, string Timeout, int MessageLimit, XmlElement[] Any) { StepType res = StepType.None; target = new System.DateTime(); timeOut = 0; timeOutSpec = false; ex = null; bool passed = true; string logMessage = ""; NotificationMessage = new NotificationMessageHolderType[1]; TerminationTime = new System.DateTime(); //Get step list for command XmlNodeList m_testList = m_TestCommon.GetStepsForCommand("PMSPullMessages"); if (m_testList != null) { //Get current step XmlNode test = m_testList[m_commandCount[PMSPullMessages]]; #region Analyze request //Timeout CommonCompare.StringCompare("RequestParameters/Timeout", "Timeout", Timeout, ref logMessage, ref passed, test); //MessageLimit CommonCompare.IntCompare("RequestParameters/MessageLimit", "MessageLimit", MessageLimit, ref logMessage, ref passed, test); #endregion //Analyze request //Generate response //TopicNamespaceLocation object targetObj; res = m_TestCommon.GenerateResponseStepTypeNotVoidTimeout(test, out targetObj, out ex, out timeOut, out timeOutSpec, typeof(NotificationMessageHolderType[])); NotificationMessage = (NotificationMessageHolderType[])targetObj; #region Serialization Temp //bool dsr = false; //XmlSerializer serializer1 = new XmlSerializer(typeof(bool)); //TextWriter textWriter = new StreamWriter("c:\\2.txt"); //serializer1.Serialize(textWriter, dsr); #endregion //Serialization Temp if (res == StepType.Normal) { //CurrentTime string CurrentTimeType = test.SelectSingleNode("ResponseParametersAdditional/CurrentTime/@type").InnerText; switch (CurrentTimeType) { case "now": { target = System.DateTime.UtcNow; break; } case "value": { target = Convert.ToDateTime(test.SelectSingleNode("ResponseParametersAdditional/CurrentTime").InnerText); break; } case "nowDiff": { int timeDiff = Convert.ToInt32(test.SelectSingleNode("ResponseParametersAdditional/CurrentTime").InnerText); target = System.DateTime.UtcNow.AddSeconds(timeDiff); break; } } //TerminationTime if (test.SelectNodes("ResponseParametersAdditional/TerminationTime[@differance=\"true\"]").Count != 0) { int timeDiff = Convert.ToInt32(test.SelectSingleNode("ResponseParametersAdditional/TerminationTime").InnerText); TerminationTime = target.AddSeconds(timeDiff); } else { TerminationTime = Convert.ToDateTime(test.SelectSingleNode("ResponseParametersAdditional/TerminationTime").InnerText); } //For tns1:Monitoring/OperatingTime/LastClockSynchronization event if (test.SelectNodes("ResponseParametersAdditional/LastClockSynchronization[@differance=\"true\"]").Count != 0) { XmlNameTable xmlNameTable = NotificationMessage[0].Message.OwnerDocument.NameTable; XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager(xmlNameTable); xmlNamespaceManager.AddNamespace("tt", "http://www.onvif.org/ver10/schema"); NotificationMessage[0].Message.SelectSingleNode("tt:Data/tt:SimpleItem[@Name=\"Status\"]/@Value", xmlNamespaceManager); //int timeDiff = Convert.ToInt32(test.SelectSingleNode("ResponseParametersAdditional/TerminationTime").InnerText); //TerminationTime = target.AddSeconds(timeDiff); } } //Log message m_TestCommon.writeToLog(test, logMessage, passed); Increment(m_testList.Count, PMSPullMessages); } else { timeOut = 0; target = new System.DateTime(); ex = null; res = StepType.None; } return(res); }