从登录方法返回意外 [英] Unexpected return from logon method
问题描述
我正在研究从 http://code.msdn.microsoft.com/ucmawcf下载的客户端程序a>。
但登录时我有意外的回复(WcfApi.TestClient,CommunicatorForm.cs,480行)
But I have an unexpected return when login (WcfApi.TestClient, CommunicatorForm.cs, Line 480)
LoginRequest credentials = new LoginRequest()
{
    Principal = _username,
密码= _password
};
LoginRequest credentials = new LoginRequest()
{
Principal = _username,
Password = _password
};
LoginResponse loginResponse = null;
LoginResponse loginResponse = null;
//登录服务。
if(_usingDuplexService)//假设_usingDuplexService = true
{
        loginResponse = _duplexClient.Logon(credentials); //返回null票证的代码和null失败原因
}
   否则
    {
        loginResponse = _client.Logon(credentials);
}
if (_usingDuplexService) //assume _usingDuplexService = true
{
loginResponse = _duplexClient.Logon(credentials); // The code that returned null ticket and null fail reason
}
else
{
loginResponse = _client.Logon(credentials);
}
//基于以下代码,我相信loginResponse.Ticket或loginResponse.FailReason必须不为null
//Base on the code following, I believe either loginResponse.Ticket or loginResponse.FailReason must not null
if(loginResponse.Ticket!= null)
{
    _ticket = loginResponse.Ticket;
if (loginResponse.Ticket != null)
{
_ticket = loginResponse.Ticket;
...
}
其他
{
    MessageBox.Show(loginResponse.FailReason);
} ...
...
}
else
{
MessageBox.Show(loginResponse.FailReason);
}
...
推荐答案
您在Wcf.Api服务端使用了哪些身份验证提供程序? 检查以确保您使用的是AD提供商,或者如果您使用的是其他用户,请根据您的用户/密码进行配置。
Which of the Authentication providers are you using on the Wcf.Api service side? Check to make sure that you are using the AD provider or if you are using one of the others, then configure them for your user/password.
这篇关于从登录方法返回意外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!