连接CRM [英] Connection to CRM
本文介绍了连接CRM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要我的网站连接到CRM这是我的code
VAR organizationUri =新的URI(ConfigurationManager.AppSettings [CRMServerUrl]); //客户端证书
VAR证书=新ClientCredentials();
credentials.UserName.UserName = @<使用者>中;
credentials.UserName.Password =<密码和GT;
//使用名为CrmConnectionStrweb.config文件中的Microsoft Dynamics CRM在线连接字符串。
使用(OrganizationServiceProxy _service =新OrganizationServiceProxy(organizationUri,空,证书,NULL))
{
的Response.Write(已连接);
}
这是我的web.config
<添加键=CRMServerUrlVALUE =HTTP://XXXXX/XRMServices/2011/Organization.svc/>
<添加键=用户名VALUE =<使用者>中/>
<添加键=密码VALUE =<密码和GT; />
它给了我这个错误消息:
出现了一个严重错误。无法与CRM服务器进行连接。该
呼叫者不是由服务认证
块引用>解决方案使用这个组件到项目
使用Microsoft.Xrm.Client;
使用Microsoft.Xrm.Sdk.Client;
使用Microsoft.Xrm.Sdk;
使用Microsoft.Xrm.Sdk.Query;
使用Microsoft.Xrm.Client.Services;创建orgnuisation服务
字符串的connectionString =URL = HTTPS://your_orgnisation.crm5.dynamics.com;用户名= USER_NAME;密码= your_password;;
CrmConnection连接= CrmConnection.Parse(的connectionString);
OrganizationService organisationservice =新OrganizationService(连接);和你做!
DONT FORFET要导入System.Runtime.serialization。
在此输入code
I need my website to connect to CRM this is my code
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"); }
and this is in my web.config
<add key="CRMServerUrl" value="http://XXXXX/XRMServices/2011/Organization.svc" /> <add key="username" value="<user>" /> <add key="password" value="<password>" />
it gives me this error message:
"A critical error has occurred. Unable to connect with CRM server. The caller was not authenticated by the service."
解决方案use this assemblies to your project
using Microsoft.Xrm.Client; using Microsoft.Xrm.Sdk.Client; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using Microsoft.Xrm.Client.Services;
create orgnuisation service
string connectionString = "Url=https://your_orgnisation.crm5.dynamics.com; Username=user_name; Password=your_password;"; CrmConnection connection = CrmConnection.Parse(connectionString); OrganizationService organisationservice = new OrganizationService(connection);
AND YOU ARE DONE !
DONT FORFET TO IMPORT System.Runtime.serialization.
enter code here
这篇关于连接CRM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文