Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF C#4.0
I am facing this error when I am invoking services in my windows phone application.
Please suggest some solution for the same.
 
sample code :
 
private void Button_Click_1(object sender, RoutedEventArgs e)
{
      ServiceReference1.ServiceClient myService = new ServiceReference1.ServiceClient();
 
      if (txtUser.Text.ToString() != null)
      {
            myService.ValidateAsync(txtUser.Text.ToString(), pwdPassword.ToString());
            System.Threading.Thread.Sleep(TimeSpan.FromSeconds(20));
            myService.ValidateCompleted += new EventHandler<ServiceReference1.ValidateCompletedEventArgs>(myService_ValidateCompleted);
       }
       else
       {
            MessageBox.Show("Enter some username or password");
       }
}
** control is not going to next function showing :
Exception - system.servicemodel.communicationexception in System.ServiceModel.ni.dll
 
private void myService_ValidateCompleted(object sender, ServiceReference1.ValidateCompletedEventArgs e)
{
       //int a = 0;
       //a = Convert.ToInt32(e.Result);

       if (e.Result== 1)
       {
            MessageBox.Show("Enter");
            // this.NavigationService.Navigate(new Uri("/TilesPage.xaml", UriKind.Relative));
       }
       else if (e.Result == 0)
       {
            MessageBox.Show("Invalid Username or Password");
       }
       else if (e.Result == -1)
       {
            MessageBox.Show("UserName doesn't exists");
       }
       else
       {
            MessageBox.Show("some exception");
       }
}
Posted 22-Feb-13 18:47pm
Edited 22-Feb-13 20:47pm
(no name)117.9K
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100