Example #1
0
 private static void ProcessSMSSender(HttpContext context)
 {
     if (context.Request["action"] == "getlist")
     {
         SMSPlugins sMSPlugins = SMSPlugins.Instance();
         context.Response.ContentType = "application/json";
         context.Response.Write(sMSPlugins.GetPlugins().ToJsonString());
         return;
     }
     if (context.Request["action"] == "getmetadata")
     {
         context.Response.ContentType = "text/xml";
         SMSSender sMSSender = SMSSender.CreateInstance(context.Request["name"]);
         if (sMSSender == null)
         {
             context.Response.Write("<xml></xml>");
             return;
         }
         context.Response.Write(sMSSender.GetMetaData().OuterXml);
     }
 }
Example #2
0
        private static void ProcessSMSSender(HttpContext context)
        {
            IDictionary <string, string> dictionary = Globals.NameValueCollectionToDictionary(context.Request.Form);

            Globals.AppendLog(dictionary, "ProcessSMSSender action:" + context.Request["action"], "", "", "/log/ConfigHandler.txt");
            if (context.Request["action"] == "getlist")
            {
                try
                {
                    SMSPlugins sMSPlugins = SMSPlugins.Instance();
                    context.Response.ContentType = "application/json";
                    Globals.AppendLog(dictionary, "ProcessSMSSender getlist:" + sMSPlugins.GetPlugins().ToJsonString(), "", "", "/log/ConfigHandler.txt");
                    context.Response.Write(sMSPlugins.GetPlugins().ToJsonString());
                }
                catch (Exception e)
                {
                    Globals.AppendLog(dictionary, "ProcessSMSSender getlist error:" + e.Message + "----" + e.StackTrace, "", "", "/log/ConfigHandler.txt");
                    //context.Response.Write(sMSPlugins.GetPlugins().ToJsonString());
                }
            }
            else if (context.Request["action"] == "getmetadata")
            {
                context.Response.ContentType = "text/xml";
                SMSSender sMSSender = SMSSender.CreateInstance(context.Request["name"]);
                Globals.AppendLog(dictionary, "ProcessSMSSender getmetadata name:" + context.Request["name"], "", "", "/log/ConfigHandler.txt");
                if (sMSSender == null)
                {
                    context.Response.Write("<xml></xml>");
                }
                else
                {
                    Globals.AppendLog(dictionary, "ProcessSMSSender getmetadata:" + sMSSender.GetMetaData().OuterXml.ToString(), "", "", "/log/ConfigHandler.txt");
                    context.Response.Write(sMSSender.GetMetaData().OuterXml);
                }
            }
        }
Example #3
0
 public static SMSSender CreateInstance(string name)
 {
     return(SMSSender.CreateInstance(name, null));
 }