Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

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()

                Please.GardaSoapClient Ws = new Please.GardaSoapClient(new BasicHttpBinding(),
                            new EndpointAddress(""));
                Ws.HelloCompleted += Ws_HelloCompleted;


            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"**
                 `enter code here`       {

                    test.Text = e.Result;

Can you help me ? :)

Sign In or Register to comment.