Search code examples
c#dynamics-crmdynamics-crm-2016dynamics-365

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


So I've got a ton of SSIS packages that are setup using the old 2011 endpoint address for their connections within c# scripts. Via code that looks like this.

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

I've been trying to figure out when or if I need to be worried about this. According to update notes the 2011 endpoints are going away. So after diving into the new documentation I finally found how to setup a CRMServiceClient object. I wrestled around with that for a little while and got it working with a connection string on my on premise demo that I was using for testing. Via code that looks like this.

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;

So what I'm trying to find out is everyone's thought's on best practices for setting up my connection objects moving forward and updating my old packages. Or if I even need to, the language was a little vague so I'm still not even sure that my packages for Online environments will need to be updated.

Cheers!


Solution

  • Yes, you'll want to leverage the latest SDK possible for the environment(s) you are targeting (not just because of 2011 endpoint deprecation but 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

    So most likely within the next year. That being said, the latest SDK still technically hits the 2011 endpoint behind the scenes (you can verify this by running Fiddler to monitor the http traffic). The idea is that at some point in the future the SDK will start hitting the webapi endpoints without the interface of the SDK changing (so still leveraging the newer connection/proxy objects and connection strings).