Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf system.servicemodel.communicationexception。在system.servicemodel.ni.dll中_Wcf_C# 4.0_Windows Phone 8 - Fatal编程技术网

Wcf system.servicemodel.communicationexception。在system.servicemodel.ni.dll中

Wcf system.servicemodel.communicationexception。在system.servicemodel.ni.dll中,wcf,c#-4.0,windows-phone-8,Wcf,C# 4.0,Windows Phone 8,当我在windows phone应用程序中调用WCF服务时,我遇到了这个错误。 请为同样的问题提出一些解决方案 示例代码: private void Button_Click_1(object sender, RoutedEventArgs e) { ServiceReference1.ServiceClient myService = new ServiceReference1.ServiceClient(); if (txtUser.Text.ToS

当我在windows phone应用程序中调用WCF服务时,我遇到了这个错误。 请为同样的问题提出一些解决方案

示例代码:

   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");
       }
   }
包括一个挡块

catch (CommunicationException commProblem)
{
     Console.WriteLine("There was a communication problem. " + commProblem.Message + commProblem.StackTrace);
     Console.Read();     
}
catch (CommunicationException commProblem)
{
     Console.WriteLine("There was a communication problem. " + commProblem.Message + commProblem.StackTrace);
     Console.Read();     
}