Reusing OrganizationServiceProxy RRS feed

  • Question

  • Hi, although I found an old post about this https://social.microsoft.com/Forums/en-US/93d273f7-6846-473b-8561-2c1c50ad28e2/connection-pool-for-organizationserviceproxy?forum=crmdevelopment, I am not sure it is the right approach now in CRM 2016. I am iterating through a csv file and running a call to CRM API for every row. I want to reuse a proxy object (I don't think running every row with same instance of the proxy is a good idea) and I wonder if I instantiate a new ManagedTokenOrganizationServiceProxy(from sdk sample) every time, I don't gain anything, right? Should I rather instantiate one time and call RenewTokenIfRequired method (on AutoRefreshSecurityToken class also from sdk samples) before every call to web service?

    As CrmConnection class is replaced by CrmServiceClient from Microsoft.Xrm.Tooling.Connector namespace, and as I see it creates OrganizationServiceProxy internally, is it something here I could use for this scenario?

    Thanks in advance

    Friday, May 20, 2016 8:57 AM