private async void appBar_OnChk(object sender, EventArgs e) { try { getCoordinatesFromLocation geocoding = new getCoordinatesFromLocation(); string location = ""; location = addressLocationtxt.Text + "+" + cityLocationtxt.Text + "+" + "Pakistan"; /////////////////////////////////////// ServiceReference1.ServiceClient clientfortesting = new ServiceReference1.ServiceClient(); clientfortesting.AddresstoCoordinatesCompleted += new EventHandler<ServiceReference1.AddresstoCoordinatesCompletedEventArgs>(AddresstoCoordinatesReturnFunction); clientfortesting.AddresstoCoordinatesAsync(location); /////////////////////////////// } catch (Exception ed) { MessageBox.Show(ed.ToString()); } }