Ejemplo n.º 1
0
        public static void testConn()
        {
            WebResponse resp = null;

            try
            {
                Conf c = new Conf();
                Dictionary <string, string> conf = c.read();
                string url = "";
                conf.TryGetValue("url", out url);

                url = "http://localhost:53013/WebSite2/WebService.asmx/HelloWorld";

                //Get input stream, it could be a file
                WebServiceConnector <XmlElement> wc = new WebServiceConnector <XmlElement>();
                resp = wc.GetDataStreamToSyncViaHttpGet(url);

                string conn = "";
                conf.TryGetValue("conn", out conn);
                SQLConnector sql = new SQLConnector(conn);

                Action      action = new Action3();
                XMLProtocol xml    = new XMLProtocol(action);

                Stream       stream = resp.GetResponseStream();
                SSOXmlReader reader = new SSOXmlReader(resp.GetResponseStream());
                xml.parse(reader);
            }
            catch (Exception ex)
            {
                logger.Fatal(ex.Message);
            }
            finally
            {
                if (resp != null)
                {
                    resp.GetResponseStream().Close();
                    resp.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public static void testConnExcel()
        {
            try
            {
                Conf c = new Conf();
                Dictionary <string, string> conf = c.read();

                string conn = "";
                conf.TryGetValue("conn", out conn);
                SQLConnector sql = new SQLConnector(conn);

                Action      action = new Action3();
                XMLProtocol xml    = new XMLProtocol(action);

                SSOExcelReader reader = new SSOExcelReader();
                xml.parse(reader);
            }
            catch (Exception ex)
            {
                logger.Fatal(ex.Message);
            }
        }