故障异常windows phone连接到WCF WP8
我创建了一个WCF,然后创建了一个WP8应用程序并添加了服务引用。错误是System.ServiceModel.ni.dll中发生的“System.ServiceModel.FaultException”类型的异常,但未在用户代码中处理 如果有人能给我一些提示,因为我已经在谷歌上搜索过了,没有发现任何相同的东西 这里出现了错误故障异常windows phone连接到WCF WP8,windows,windows-phone-7,windows-phone-8,Windows,Windows Phone 7,Windows Phone 8,我创建了一个WCF,然后创建了一个WP8应用程序并添加了服务引用。错误是System.ServiceModel.ni.dll中发生的“System.ServiceModel.FaultException”类型的异常,但未在用户代码中处理 如果有人能给我一些提示,因为我已经在谷歌上搜索过了,没有发现任何相同的东西 这里出现了错误 public void EndAddUser(System.IAsyncResult result) { object[] _args = new object
public void EndAddUser(System.IAsyncResult result)
{
object[] _args = new object[0];
base.EndInvoke("AddUser", _args, result);
}
我的主要课程:
public partial class MainPage : PhoneApplicationPage
{
private Service1Client _serviceClient;
// Constructor
public MainPage()
{
InitializeComponent();
_serviceClient = new Service1Client();
_serviceClient.LoginUserCompleted += new
}
private void loginBtn_Click(object sender, RoutedEventArgs e)
{
_serviceClient.LoginUserAsync(userNameTxtBox.Text, passwordTxtBox.Text);
}
private void newAccountBtn_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Uri("/AddAccount.xaml", UriKind.Relative));
}
private void _serviceClient_LoginUserCompleted(object senter,
LoginUserCompletedEventArgs e)
{
if (e.Error == null && e.Result != null)
{
MessageBox.Show("Welcome " + e.Result + "!");
}
else
{
MessageBox.Show("Could not log in. Please check user name/password and try
again.");
}
}
}
public partial class AddAccount : PhoneApplicationPage
{
private Service1Client _serviceClient;
public AddAccount()
{
InitializeComponent();
_serviceClient = new Service1Client();
_serviceClient.AddUserCompleted += new EventHandler<AsyncCompletedEventArgs>
(_serviceClient_AddUserCompleted);
}
private void addAccountBtn_Click(object sender, RoutedEventArgs e)
{
_serviceClient.AddUserAsync(fullnameTxtBox.Text, userNameTxtBox.Text,
passwordTxtBox.Text);
}
void _serviceClient_AddUserCompleted(object sender, AsyncCompletedEventArgs e)
{
if (e.Error == null)
{
MessageBox.Show("User account created. Please login");
this.NavigationService.GoBack();
}
else
{
MessageBox.Show("User account could not be added, Please try again");
}
}
}
1.捕捉异常2。在异常3上调用.ToString。复制调用结果的整个文本,然后单击4。请回答您的问题并在此处添加此信息。它可能包含了解决问题所需的所有信息。请检查您是否有正确的url,以及服务是否正常工作。要进行此测试,您可以使用VisualStudio所在的同一文件夹中的WCFTestClient.exe(devenv.exe)