如何在连接到Dynamics CRM Web服务时指定凭据?

时间:2010-12-09 11:11:04

标签: web-services authentication dynamics-crm microsoft-dynamics

有人可以向我解释如何为Dynamics CRM网络服务指定身份验证吗?我目前的尝试没有产生任何结果:

  var svc =  new CrmServiceSoapClient("CrmServiceSoap");
  svc.ClientCredentials.UserName.UserName = Resources.UserName;
  svc.ClientCredentials.UserName.Password = Resources.Password;
  svc.ClientCredentials.Windows.ClientCredential.UserName = Resources.UserName;
  svc.ClientCredentials.Windows.ClientCredential.UserName = Resources.Password;
  return svc;

谢谢!

1 个答案:

答案 0 :(得分:1)

我做其中一个(可能不是确切的代码,但你明白了):

svc.ClientCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
svc.ClientCredentials.Windows.ClientCredential = new ClientCredential("", "", "");