Why my application does't work when I call my ASMX webServices ?

My application Android display this error : "Object reference not set an instance of an object" when I execute my code.
It's as if there was nothing in "e.Result". However, My webservice works well

     public MainPage()
            {
                InitializeComponent();


                Please.GardaSoapClient Ws = new Please.GardaSoapClient(new BasicHttpBinding(),
                            new EndpointAddress("http://webgarda20170508110006.azurewebsites.net/Garda.asmx"));
                Ws.HelloCompleted += Ws_HelloCompleted;
                Ws.HelloAsync();

                }

            private void Ws_HelloCompleted(object sender, Please.HelloCompletedEventArgs e)
            {
                Device.BeginInvokeOnMainThread(async () => {
                        string error = null;
                         if (e.Error != null)
                             error = e.Error.Message;
                         else if (e.Cancelled)
                             error = "Cancelled";

                         if (!string.IsNullOrEmpty(error))
                         {
                             await DisplayAlert("Error", error, "OK", "Cancel"); **//error => "Object reference not set an instance of an object"**
                         }
                         else 
                 `enter code here`       {

                    test.Text = e.Result;
                   }
                });
            }
        } 

Can you help me ? :)
Thanks

Sign In or Register to comment.