小编Dan*_*nia的帖子

连接到CRM

我需要我的网站连接到CRM这是我的代码

        var organizationUri = new Uri(ConfigurationManager.AppSettings["CRMServerUrl"]);

        //Client credentials
        var credentials = new ClientCredentials();
        credentials.UserName.UserName = @"<user>";
        credentials.UserName.Password = "<password>";
        // Use the Microsoft Dynamics CRM Online connection string from the web.config file named "CrmConnectionStr".
        using (OrganizationServiceProxy _service = new OrganizationServiceProxy(organizationUri, null, credentials, null))
        {
            Response.Write("Connected");
        }
Run Code Online (Sandbox Code Playgroud)

这是在我的web.config中

 <add key="CRMServerUrl" value="http://XXXXX/XRMServices/2011/Organization.svc" />
<add key="username" value="<user>" />
<add key="password" value="<password>" />
Run Code Online (Sandbox Code Playgroud)

它给了我这个错误信息:

"发生了严重错误.无法与CRM服务器连接.调用者未通过该服务进行身份验证."

c# asp.net dotnetnuke crm web-config

5
推荐指数
3
解决办法
2万
查看次数

标签 统计

asp.net ×1

c# ×1

crm ×1

dotnetnuke ×1

web-config ×1