Wcf system.servicemodel.communicationexception。在system.servicemodel.ni.dll中
当我在windows phone应用程序中调用WCF服务时,我遇到了这个错误。 请为同样的问题提出一些解决方案 示例代码: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
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();
}