Hosting the Data Exchange service in a Windows Service
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.
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.
Download the DataExchange.Commerce SDK package.
Unzip and follow the steps in the ReadMe.txt to build the solution.
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.
The Routing.SynchronizationService project contains the code for the Windows Service.
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:
<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.
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.
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