private async void cmdDecnx_Click(object sender, EventArgs e) { _CancellationAsync = new CancellationTokenSource(); WSR_Params p = new WSR_Params(); p.Add("pseudo", txtPseudo.Text); p.Add("password", lstPseudo.Text); WSR_Result r1 = await ConsumeWSR.Call(@"http://localhost:4000/Service.svc/Logout", p, TypeSerializer.Json, _CancellationAsync.Token); }
private async void cmdCnx_Click(object sender, EventArgs e) { _CancellationAsync = new CancellationTokenSource(); WSR_Params p = new WSR_Params(); p.Add("pseudo", txtPseudo.Text); WSR_Result r1 = await ConsumeWSR.Call(@"http://*****:*****@"http://localhost:4000/Service.svc/GetPseudos", p, TypeSerializer.Json, _CancellationAsync.Token); * * List<string> lst = new List<string>(); * lst = (List<string>)r2.Data; * lstPseudo.DataSource = lst;*/ }
public void TestVerifParamTypeOK() { WSR_Params p = new WSR_Params(); string key = "paramString"; string param = "essai"; string value = null; p.Add(key, param); WSR_Result rExpected = new WSR_Result(); rExpected = null; ServiceForUnitTest service = new ServiceForUnitTest(); WSR_Result rActual = new WSR_Result(); rActual = service.VerifParamTypeTest(p, key, out value); Assert.AreEqual(rExpected, rActual); }
public void TestVerifParamExistNotOK() { WSR_Params p = new WSR_Params(); string key = "paramString"; string param = "essai"; object data = null; p.Add(key, param); WSR_Result rExpected = new WSR_Result(); rExpected = null; ServiceForUnitTest service = new ServiceForUnitTest(); WSR_Result rActual = new WSR_Result(); rActual = service.VerifParamExistTest <string>(p, "paramKo", out data); Assert.AreNotEqual(rExpected, rActual); }
static void Main(string[] args) { string login = "******"; WSR_Params wsr_params = new WSR_Params(); wsr_params.Add("pseudo", "toto"); Console.WriteLine(ExecuteAsync(login, wsr_params, TypeSerializer.Json).Result.Data); wsr_params = new WSR_Params(); wsr_params.Add("pseudo", "titi"); Console.WriteLine(ExecuteAsync(login, wsr_params, TypeSerializer.Json).Result.Data); wsr_params = new WSR_Params(); wsr_params.Add("pseudo", "titi"); Console.WriteLine(ExecuteAsync(login, wsr_params, TypeSerializer.Json).Result.Data); string getUsers = "http://localhost:53494/ServiceRDM.svc/GetPseudos"; Console.WriteLine(ExecuteAsync(getUsers, wsr_params, TypeSerializer.Xml).Result); Console.Read(); }