Hosting the Data Exchange service in a Windows Service

Current version: 8.2

The following steps will allow you to run the Data Exchange service as a Windows Service instead of a Sitecore job. The Data Exchange package must be installed in Sitecore, as this will remain the main source of configuration. Also, the Data Exchange Service must be run on the same machine that is running Sitecore Content Management.

  1. When you install the DataExchange.Core package, it will set up a Sync Task to run the Data Exchange synchronization service. Because this is running as a Windows Service, it can be disabled or deleted.

    • Delete Task:

      • Browse to Open /sitecore/system/Tasks/Schedules/Commerce Synchronization Schedule.

      • Delete the Item.

    • Disable Task:

      • Browse to Open /sitecore/system/Tasks/Schedules/Commerce Synchronization Schedule.

      • You cannot disable the task entirely. Instead, set the “Schedule” date to be sometime in the far future. For example, set the year to 2100.

  2. Download the DataExchange.Commerce SDK package.

  3. Unzip and follow the steps in the ReadMe.txt to build the solution.

  4. Expand the Sitecore.Commerce.DataExchange.Providers.DynamicsRetail update package and the package.zip contained within.

    • Inside the addedfiles folder, take the Templates folder and copy it into the same folder as the Windows Service .exe.

    • Inside the addedfiles folder, take the contents of the bin folder and copy it into the same folder as the Windows Service .exe.

    • From the Commerce Server install folder, take CommerceServer.Core.Catalog.dll and CommerceServer.Core.CrossTier.dll and add them into the same folder as the Windows Service .exe.

  5. The Routing.SynchronizationService project contains the code for the Windows Service.

  6. Inside the App.config (which becomes Sitecore.Routing.SynchronizationService.exe.config after the build), change below according to your Sitecore Commerce Catalog Web Service information:

    RequestResponse
    
    <client>
    endpoint address="http://localhost:2000/SolutionStorefrontSite_CatalogWebService/CatalogWebService.asmx" 
    binding="basicHttpBinding" bindingConfiguration="CatalogWebServiceSoap" 
    contract="Sitecore.Commerce.Catalog.CatalogWebServiceSoap" name="CatalogWebServiceSoap"/>
    </client>
    

    Note: Windows Authentication is required to access Sitecore Commerce catalog web service.

  7. Inside the SynchronizationService.cs class, in its OnStart method, update the code with the connection details to your Sitecore instance. Ideally, you should read these settings from a configuration file instead of hard coding them.

  8. Details on how to install the resulting .exe as a service are located at: https://msdn.microsoft.com/en-us/library/zt39148a%28v=vs.110%29.aspx#BK_Install

Do you have some feedback for us?

If you have suggestions for improving this article,