从登录方法返回意外 [英] Unexpected return from logon method

查看:81
本文介绍了从登录方法返回意外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究从 http://code.msdn.microsoft.com/ucmawcf

但登录时我有意外的回复(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆