在 c# for dynamics 365/crm 2016 中创建 orginzation 服务代理的最佳实践

Best practices for creating orginzation service proxies in c# for dynamics 365/crm 2016

所以我有大量的 SSIS 包,这些包是使用旧的 2011 端点地址设置的,用于它们在 c# 脚本中的连接。通过看起来像这样的代码。

OrganizationServiceProxy crmService;
crmService = new OrganizationServiceProxy(new Uri(https://someorg.crm.dynamics.com/XRMServices/2011/Organization.svc), null, crmCredentials, null);

我一直在想什么时候或者是否需要为此担心。根据更新说明,2011 端点即将消失。因此,在深入研究新文档后,我终于找到了如何设置 CRMServiceClient 对象。我为此苦苦思索了一会儿,并在我用于测试的本地演示中使用了一个连接字符串。通过看起来像这样的代码。

CrmServiceClient cService;

IOrganizationService service;

cService = new CrmServiceClient(string.Format("Authtype=IFD;Url=https://{0}.someclient.com:{1}/{0}; Username={2}; Password={3}", Variables.Environment, Variables.Port, Variables.CrmUser, Variables.CrmPassword));

service = cService.OrganizationServiceProxy;

所以我想了解的是每个人对设置我的连接对象并更新我的旧包的最佳实践的想法。或者如果我需要的话,语言有点含糊,所以我仍然不确定我的在线环境包是否需要更新。

干杯!

是的,您可能希望针对您的目标环境利用最新的 SDK(不仅仅是因为 2011 端点弃用,还因为 also Azure deprecating ACS). At this time the best information we have on when the 2011 endpoint will officially go away is:

As of the release of Microsoft Dynamics CRM Online 2016 Update 1 and Microsoft Dynamics CRM 2016 Service Pack 1 (8.1.0), the CRM 2011 endpoint has been deprecated. The 2011 endpoint will be removed some time after the release of Dynamics 365 version 9

所以很可能在明年。话虽如此,最新的 SDK 在技术上仍然在幕后命中 2011 端点(您可以通过 运行 Fiddler 监控 http 流量来验证这一点)。这个想法是,在未来的某个时候,SDK 将开始访问 webapi 端点,而无需更改 SDK 的接口(因此仍然利用更新的 connection/proxy 对象和连接字符串)。