and class :
public class SaldoAutomaintain
{
public string SisaSaldo { get; set; }
}
and this is my code webservice :
public async Task<List> GetSaldo(string urilogin)
{
List Items = new List();
//var Items;
try
{
var response = await client.GetAsync(urilogin);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
var results = JsonConvert.DeserializeObject<List>(content);
Items = results;
}
}
catch (Exception ex)
{
return null;
}
return Items;
}
and how i use the method :
async void getdata()
{
string uri1 = "https://h2o-internasional.com/webservice/get-automaintain-saldo.php?cNoMbr=0000030&Signature=NjVhNTQ1MGJmOWU0ZTY5ZDQwNTkxZWJlYzcwNGEyOGY5ZWJiZWRhM2Q3MzE0ZTE2YzY5MzI4YmVhNDJiYWI1Mw==";
SaldoAutomaintain ausaldo;
try
{
var ax = await serv.GetSaldo(uri1);
if (ax != null)
{
ausaldo = ax[0];
string asu = ausaldo.SisaSaldo;
await DisplayAlert("Got it", asu, "Ok");
}
else {
await DisplayAlert("Uh-Oh", "Need Internet !!" + ex, "Ok");
}
}
catch (Exception ex) { await DisplayAlert("Uh-Oh", ex.ToString(), "Ok"); }
}
but asu = "".
whats wrong?