Consume Web Service in Windows (WinForms) Application

Last Reply on Jan 06, 2014 05:46 AM By Pradip

Posted on Jan 06, 2014 05:30 AM

I have created web service and also call the method but not getting the output in windows mobile application,

can anyone help me??

here is my code.

 private void button1_Click(object sender, RoutedEventArgs e)

            string uname, pwd;
            uname = textBlock1.Text;
            pwd = textBlock2.Text;
            ServiceReference2.finWebServiceSoapClient sc = new ServiceReference2.finWebServiceSoapClient();
            sc.resultAsync(textBlock1.Text, textBlock2.Text);
            sc.resultCompleted += new EventHandler<ServiceReference2.resultCompletedEventArgs>(sc_resultCompleted);
            textBlock3.Visibility = Visibility.Visible; 
           //  string url = "";          
           //  HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);

            //ServiceReference1.CommonWSEndPointClient client = new ServiceReference1.CommonWSEndPointClient();
            //client.m98459Completed += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_completed);

        private void sc_resultCompleted(object sender, resultCompletedEventArgs e)
            //listBox1.ItemsSource= e.Result;
            textBlock3.Text = e.Result.ToString();