static void Main(string[] args) { StringToJSONConverter stringToJSON = new StringToJSONConverter(); string URL = ""; while (true) { Console.WriteLine("Unesite URL: "); URL = Console.ReadLine(); string jsonRequest = stringToJSON.Convert(URL); Console.WriteLine(jsonRequest); XNode xmlNode = JsonConvert.DeserializeXNode(jsonRequest, "Request"); CommunicationBusService CBService = new CommunicationBusService(xmlNode); Console.WriteLine(CBService.Run(xmlNode)); XElement element = xmlNode.Document.Element("Request"); } }
static void Main(string[] args) { StringToJSONConverter stringToJSON = new StringToJSONConverter(); char exit = 'a'; string URL = ""; bool urlValid = false; string zahtev = ""; while (exit.ToString().ToUpper() != "X") { while (!urlValid) { Console.WriteLine("Unesite URL: "); URL = Console.ReadLine(); zahtev = stringToJSON.Convert(URL); urlValid = true; } string jsonZahtev = stringToJSON.Convert(URL); Console.WriteLine(jsonZahtev); XNode xmlNode = JsonConvert.DeserializeXNode(jsonZahtev, "Zahtev"); CommunicationBusService CBService = new CommunicationBusService(xmlNode); Console.WriteLine(CBService.Run(xmlNode)); XElement element = xmlNode.Document.Element("Zahtev"); Console.WriteLine(element.ToString()); //Console.WriteLine(XMLToDBAdapter.XMLToSql(xmlNode)); urlValid = false; //Izlaz Console.WriteLine("Unesite 'X' da izadjete iz aplikacije" + System.Environment.NewLine); exit = Console.ReadKey().KeyChar; } }