'How to solve system.net.webException in xamarin android and asmx webservice

hi i need help please i created an app in xamarin android with an asmx webservice the webservice works fine but when i call it in my android app i get this exception system.net.webexception Thanks for your help

//webservice

public class GespharServiceWeb : System.Web.Services.WebService {

    string conString = "Server=.\\SQLEXPRESS; Database=pharmaMobile;           User Id=sa ; Password=@peter; ";


    [WebMethod]
    public void ajoutProduit(string nomprod, int prixach, int prixvente, string dateexpir, int quantitestock)
    {
      
        SqlConnection con = new SqlConnection(conString);
        con.Open();
        SqlCommand Cmd = new SqlCommand();
        Cmd.Connection = con;
        Cmd.CommandText = "Insert into [pharmaMobile].[dbo].[Produit](NomProduit,PrixAchat,PrixVente,DateExpir,QuantiteStock) Values ('"+nomprod+"','"+prixach+"','"+prixvente+"','"+dateexpir+"','"+quantitestock+"') ";
        Cmd.ExecuteNonQuery();
    
      
    }

/calling the webservice in xamarin android after generating the proxy class/

btnAdd.Click += delegate {

                  //setupList();
               
                GespharServiceWeb ges = new GespharServiceWeb();
                ges.ajoutProduit(edtNom.Text, int.Parse(edtPrix.Text), int.Parse(edtPrix2.Text), edtDate.Text, int.Parse(edtQte.Text));

               


            };


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source