【发布时间】:2014-01-24 09:47:48
【问题描述】:
我目前正在尝试找出失败的原因。
这是我在 WCF 服务之间构建连接组织 Web 服务的对象的方式。部署是 IFD/ADFS
string uname = WebConfigurationManager.AppSettings["uname"];
string password = WebConfigurationManager.AppSettings["password"];
//string domain = WebConfigurationManager.AppSettings["domain"];
//Construct connection objects
Uri _organizationUri = new Uri(WebConfigurationManager.AppSettings["url"]);
Uri _homeRealmUri = null;
ClientCredentials _credentials = new ClientCredentials();
OrganizationServiceProxy _orgProxy;
IOrganizationService _service;
IServiceConfiguration<IOrganizationService> config;
//Initialize connection objects
public void init()
{
_credentials.Windows.ClientCredential = new System.Net.NetworkCredential(uname, password);
config = ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(_organizationUri);
_orgProxy = new OrganizationServiceProxy(config, _credentials);
//_orgProxy = new OrganizationServiceProxy(_organizationUri, _homeRealmUri, _credentials, null);
_service = (IOrganizationService)_orgProxy;
}
尝试检索(或通过 _service 的任何其他功能)
LeadEntity = _service.Retrieve("lead", leadID, new ColumnSet(true));
给我一个错误提示“登录尝试失败!”
然后我做了一些谷歌搜索,发现有人建议输入这样的域,例如 uname@domain。这会将错误更改为:
与目标“https://adfstst.xyxy.com/adfs/services/trust/13/kerberosmixed”的“https://adfstst.xyxy.com/adfs/services/trust/13/kerberosmixed”的 SOAP 安全协商失败。有关详细信息,请参阅内部异常
内部异常是这样说的:
初始化安全内容失败。确保服务主体名称正确。
任何关于如何修复连接的建议将不胜感激。
【问题讨论】:
标签: c# wcf dynamics-crm-2011 adfs