using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; namespace EgwProxy.Gomba.Test { internal class Program { static void Main(string[] args) { // gestire da conf se saltare certificato ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; string linea = "-----------------------------"; Console.WriteLine(linea); Console.WriteLine("Test comunicazione Gomba"); Console.WriteLine(linea); Console.WriteLine(); string escimi = "N"; // init proxy SOAP GombaServ.lwpServiceClient gombaConn = new GombaServ.lwpServiceClient(); //GombaServ.lwpServiceClient gombaConn = new GombaServ.lwpServiceClient("lwpServicePortBinding", new System.ServiceModel.EndpointAddress("https://308gomba:8000/ws")); int idxReq = 0; Console.WriteLine("Vuoi inviare richiesta peso? (S/N)"); escimi = Console.ReadLine().ToUpper(); if (escimi == "S") { var answ1 = gombaConn.memWeight("IN", $"{idxReq}", $"ODL000000{idxReq}", "", "", "", "", ""); //var answ1 = gombaConn.memWeight("IN", $"{idxReq}", $"ODL000000{idxReq}", "INGRESSO", "15000", "PROVA", "2023.09.12", "11.00"); var answ2 = gombaConn.memWeight("OUT", $"{idxReq}", $"ODL000000{idxReq}", "USCITA", "25000", "PROVA", "2023.09.12", "12.00"); } // lettura Console.WriteLine("Pronto per ciclo lettura, premere un tasto per continuare"); Console.ReadLine(); escimi = "N"; while (escimi != "S") { Console.WriteLine($"{linea} {DateTime.Now:HH:mm:ss.fff} {linea}"); var results = gombaConn.reqWeightList("ALL", "01/01/2023", "12/09/2023"); foreach (var item in results) { string pesata = $"rm: {item.rm} | DI: {item.dateIn} | DO: {item.dateOut} | BI: {item.balanceIn} | BO: {item.balanceOut} | WI: {item.weightIn} | WO: {item.weightOut} | net: {item.net} | MI: {item.idMemIn} | MO: {item.idMemOut} | Feed: {item.feedback} | note: {item.notes}"; Console.WriteLine(pesata); } Console.WriteLine($"{linea} {DateTime.Now:HH:mm:ss.fff} {linea}"); Console.WriteLine(); Console.WriteLine("Vuoi uscire? (S/N)"); escimi = Console.ReadLine().ToUpper(); } } } }