Running the Data Exchange service from a Console Application
The following steps will allow you to run the Data Exchange service from a Console Application instead of a Sitecore job. You still need to install the Sitecore.Commerce.DataExchange.Providers.DynamicsRetail package in Sitecore, as this will remain the main source of configuration.
-
When you install the DataExchange.Core package, it will set up a Sync Task to run the Data Exchange synchronization service. Because this will be running as a Console Application, 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 DataExchange.Console project contains the code for the console application
-
Inside the App.config, which becomes Sitecore.Commerce.DynamicsRetail.Synchronization.Console.exe.config after the build, change below according to your Sitecore instance information:
RequestResponse<appSettings> <add key="Host" value="storefront" /> <add key="UserName" value="sitecore\admin" /> <add key="Password" value="b" /> <add key="SitecoreDatabase" value="master" /> </appSettings>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.
Once the routing settings have been set in Sitecore:
-
Run Sitecore.Commerce.DynamicsRetail.Synchronization.Console.exe.
-
It should output information in the console window, and eventually complete.
-
If it did not work, look at /sitecore/Commerce/Commerce Channels/Contoso/Channel History/ or /sitecore/Commerce/Dynamics Routing Extensions/Dynamics Routes/Route_SyncSitecoreCommerceChannel_Contoso_AzureAxVm/Route History for the latest history file. The Tracking Log property will display log output.
-
If there are no errors from console output, but there was no catalog XML generated, clear the "Last Run" and "Requested At" values, and set "Repeat Delay" to a smaller value, such as 2 instead of the default 120, under /sitecore/Commerce/Commerce Synchronization/Commerce Routes/Route Requests/Contoso Commerce Route Request.
-
Once the execution is completed, the catalog XML should be generated under “c:\Sitecore Synchronization Data\Working\Contoso_Dev\”. This location is defined by /sitecore/Commerce/Dynamics Routing Extensions/Commerce Endpoints/Endpoint_FileSystem_Contoso_Dev_Working (or _Archive).
-
If the Step_PublishExtract is enabled, which is the default, the catalog data should be imported. You can validate this in catalog manager by looking at the import status/history.