Tuesday, July 23, 2013

Access Xml Webservice in Windows Phone to insert data in database

Step 1: We call a web service FWebService:-


FWebService.Service1SoapClient client = new FWebService.Service1SoapClient();
              
 client.NewUserCompleted += new EventHandler<FWebService.NewUserCompletedEventArgs>(client_NewUserCompleted);

client.NewUserAsync(textBox1.Text, textBox2.Text, textBox3.Text);

Step 2 : Check the value returning from webservice 

                  Here I returned 1 or 0 from web service.

       void client_NewUserCompleted(object sender, ForumWebService.NewUserCompletedEventArgs e)
        {
            if (e.Result == 1)
            {
                MessageBox.Show("Account Created Successfully");
            }
            else if (e.Result == 0)
            {
                MessageBox.Show("Account not Created or email_id exists");
            }
        }