private void CallQuery5(MessageParameterState msgState, MessageTemplate msgTemplate, Sender sndr) { DateTime toDate = new DateTime(); DateTime fromDate = new DateTime(2015, 10, 1); for (int i = 0; i < msgTemplate.messageSize; i++) { XElement messageNode = new XElement("message"); XAttribute att = new XAttribute("commandType", "query5"); messageNode.Add(att); XElement keyTypenode = new XElement("keyType", "string"); XElement valueTypeNode = new XElement("valueType", "ListOfString"); XElement startTime = new XElement("startTime", fromDate); XElement endTime = new XElement("endTime", toDate); messageNode.Add(keyTypenode); messageNode.Add(valueTypeNode); messageNode.Add(startTime); messageNode.Add(endTime); Message msg = new Message(); msg.fromUrl = localUrl; msg.toUrl = remoteUrl; msg.content = messageNode.ToString(); //Console.WriteLine("msg : " + msg.content); if (!sndr.sendMessage(msg)) { return; } } }
private void CallQuery3(MessageParameterState msgState, MessageTemplate msgTemplate, Sender sndr) { for (int i = 0; i < msgTemplate.messageSize; i++) { XElement messageNode = new XElement("message"); XAttribute att = new XAttribute("commandType", "query3"); messageNode.Add(att); XElement keyTypenode = new XElement("keyType", "string"); XElement valueTypeNode = new XElement("valueType", "ListOfString"); XElement patternNode = new XElement("pattern", "1"); messageNode.Add(keyTypenode); messageNode.Add(valueTypeNode); messageNode.Add(patternNode); Message msg = new Message(); msg.fromUrl = localUrl; msg.toUrl = remoteUrl; msg.content = messageNode.ToString(); //Console.WriteLine("msg : " + msg.content); if (!sndr.sendMessage(msg)) { return; } } }