How to: Replicate from/to LS Central in SaaS

In this article

Data Director configuration

LS Central configuration

Connecting with oAuth

DD can replicate data from and to a SaaS location using LS Central Web Services version 1.0. All versions of LS Central or LS Nav can replicate to and from SaaS, just in older versions the connection string has to be entered manually in the Distribution Location card for SaaS. For later versions, the most convenient way is to set up a Web Server section and then set Replication section to Use Web Service Connection as it will use all the configuration data from the Web Server section to generate the WS URL. Then just choose either LSWS or LSWS-S2S as Version depending on the Authentication mode used to connect to LS Central Web Services.

The format of the Database connection string would be like this: Server=<RetailWebServices Url>;User=<user>;Pwd=<password>;|lsws|none

Note: Do not include "|lsws|none" when entering the connection string manually as this will be added at end of the string by Version setting.

To set Protocol type for WS Connection add ;net=xxx; to the connection string where xxx is one of these options: SystemDefault, Ssl3, Tls, Tls11, Tls12, Tls13,S2S

Data Director configuration

  • Select the Use WS check box in the App Config tab.
  • Default Batch Size is used to break up the job into smaller packages while communicating with LS Central Web Service.
  • Timeout for each call to LS Central Web Service.

LS Central configuration

  1. Open Web Service Setup - Web Requests 1.0, and check if these web requests exist and are active and have a valid Request and Response XML Setup. This setup can be exported from Demo Data and imported if it is not available or not with the correct layout.
    • GET_TABLE_DATA
    • GET_TABLE_DATA_BY_PRIMARY_KEY
    • WEB_REPL_ADD_TABLE
    • WEB_REPL_END_PACKET
    • WEB_REPL_EXE_PACKET
    • WEB_REPL_START_PACKET
  2. Set up Distribution Location, where Db Server Name points to the RetailWebServices URL, and include User ID and Password, if needed. LS Central version 21 includes a new setting, Data Director Connection, in the Replication section to select different types of connections. Choose Web SSL to connect with User name or Web key.

  3. Select Version for Central Web Service (lsws):

  4. To set a different batch size for a job from the Default batch size found in Configuration tool, open Scheduler Job page, set the batch size to be used in the Integer field in the Object Setup FastTab:

  5. To let DD commit every batch while running Insert job, enter COMMIT in the Additional Parameter field in the DD Setup FastTab:

Connecting with oAuth

  1. To connect to SaaS with oAuth, choose either Web S2S or Use Web Service Connection. For older versions of LS Central, enter the SaaS URL in the Db Server Name field, client ID in the User ID field, client secret as Password, and the tenant ID in the Db. Path & Name field.

  2. Set S2S as Plugin String for the version entry.

If the connection string is built by manually entering values in the Part 1 and Part 2 fields, the string will look something like this:

company=mycompany;url=http://myserver.dynamics.com/Production/WS/mycompany/Codeunit/RetailWebServices;clientid=ClientId;clientsecret=ClientSecret;tenant=TenantId;|lsws|s2s

Note: Do not include "|lsws|s2s" when entering the connection string manually as this will be added at end of the string by Version setting.

Note: If oAuth Scope is not the standard Microsoft scope, the correct scope URL can be changed in the Data Director config file. Open the lsretail.config file, located in DD Data folder, and change <S2SScope> to correct scope URL.