BEC Windows Service Configuration

In this article

Configuring LSBECWinService

Logging configuration

The default location for the Windows Service is C:\LS Retail\LSBEC\LSBECWinService.

The LSBEC.WinService.exe.config file may need to be modified. You must restart the LSBECWinService (LS Booking Engine Connector) Windows Service each time you modify the config file.

  • C:\WINDOWS\system32>sc.exe stop LSBECWinService
  • C:\WINDOWS\system32>sc.exe start LSBECWinService

Usually, you must change the Business Central URL, username, or password. It supports Business Central Basic Auth, OAuth and NTLM authentications.

The WCF service is configured to listen on SSL (port 443), non-SSL (port 80), or both. There are pre-configured config files that the LSBEC.WinService.exe.config can use (see <services configSource> xml tag).  Other changes to LSBEC.WinService.exe.config are not necessary.

Click here for more detailed information about the LSBEC.WinService.exe.config file.

All other configurations are made within LS Central for hotels - BEC application.

Important logging data is stored in the LS Central BEC Log table, but detailed error logging is also stored in text files using Nlog. See more information about Nlog below.

You can test the connection to the BEC Windows service from a browser (Chrome) http://localhost:8787/LSCentralService/ping.

This ping does not check the connection to Business Central, but it does check if BEC is listening on the port for incoming web requests.

Once you have completed the BEC setup, you can ping the Channel Management System from the BEC Job page, action Ping Channel Mgt, where this action uses an http client to call the BEC Windows service which in turn calls the Channel Mgt System. This is a good way to test the connection from BC to the Channel Mgt System.

Note:  The LS Service Config URL must be set in Business Central.

Configuring LSBECWinService

The default location for the Windows Service config file is C:\LS Retail\LSBEC\LSBECWinService\LSBEC.WinService.exe.config 

<configuration>

<appSettings>

<add key="LSCentral.Url" value="http://localhost:9048/WS-47262/ODataV4/BECWebServices/" />

<add key="LSCentral.Company" value="CRONUS - LS Central" />

<add key="LSCentral.UserName" value="kassi" />

<add key="LSCentral.Password" value="xxx" />

<add key="LSCentral.Timeout" value="20" />

<!-- LSCentral.UseBasicAuth, true|false -->

<add key="LSCentral.UseBasicAuth" value="false" />

<!-- LSCentral.Properties, empty processes all properties, or specify, "prop1|prop2" -->

<add key="LSCentral.Properties" value="" />

<!-- LSCentral.BookingEngineConnectors, empty processes all channel mgt system (BEC) in BC, or specify, "SYNXIS|SITEMINDER" -->

<add key="LSCentral.BookingEngineConnectors" value="" />

<!-- instead of LSCentral.UserName, password and timeout use these OAuth values when "OAuth.UseOAuth" is true -->

<add key="OAuth.UseOAuth" value="false" />

<add key="OAuth.Tenant" value="952553e1-1d21-4b15-9223-074be4c8cc5b" />

<add key="OAuth.ClientId" value="2ae1bca4-e0b6-449c-b148-e55f743b6c55" />

<add key="OAuth.ClientSecret" value="xxxx" />

<add key="OAuth.Scope" value="https://api.businesscentral.dynamics.com/.default" />

<add key="OAuth.BCUrl" value="https://api.businesscentral.dynamics.com/v2.0" />

<add key="OAuth.Company" value="Cronus QA20" />

<add key="OAuth.Environment" value="QA20_0" />

</appSettings>

</configuration>

Parameter Description
LSCentral.Url The url to the LS Central web service.

http://BCWebServer:PORTNO (ie.7048)/BCSERVICEINSTANCE(ie.BC170)/OData4/BECWebServices

LSCentral.Company The company name used (CRONUS - LS Central)
LSCentral.UserName The Windows account used to authenticate against the LS Nav/Central web service, usually has role SUPER in LS Nav/Central and is dbo or has equivalent rights in LS Nav/Central database.
LSCentral.Password The password for the BOConnection.Nav.UserName/BOUser
LSCentral.UseBasicAuth If true, Basic Auth is used to connect to the BC web service instead of Windows authentication
LSCentral.Properties If empty, all properties in BEC are processed by this service.

Or you can specify the properties to process (prop1|prop2|prop3..).  Separated by „|“.

This provides flexibility for LSBECWinService to process different properties.

Note: Not all Channel Management Systems support different URL per property.

LSCentral.BookingEngineConnectors If empty, this service processes all Channel Management Systems.

Or you can specify the Channel Management Systems (SynXis|SiteMinder). Separated by „|“.

This provides flexibility for LSBECWinService to process different Channel Management Systems.

OAuth.UseOAuth If true, OAuth is used to connect to the BC web services instead of LSCentral.UserName andLSCentral.Password.
BC in SaaS must use OAuth.

You can encrypt the password with the LSOmniPasswordGenerator.exe, which is included in the Tool package. The password ends with :encr: indicating that the password is encrypted.

  <add key="LSCentral.Password" value="xr53uLy7qRA+ukzeRdqvuw==:encr:"/>

Note: When you are using a domain, add the domain before the user name, DOMAIN\username:

  <add key="LSCentral.UserName" value="LSRETAIL\kassi"/>

Note:  LSCentral.Properties and LSCentral.BookingEngineConnectors are filters of what the Windows Service processes. Ensure that each Property and BookingEngineConnector in BEC is only processed in one Windows service.

Logging configuration

The logging configuration settings are stored in the NLog.config file, which by default is located under C:\LS Retail\LSBEC\LSBECWinService\.

The logger minlevel key determines how much logging is done. It can be Trace, Debug, Info, and Error. Default setup is Debug, but production minlevel should be Error. By setting the minlevel to:

Error: Only logs the error.
Info: Error and logs information about the WCF web requests.
Debug: Info and all the web service calls are logged (Request and Response xml).
  • It is very helpful to see the XML sent to the LS Nav/Central web service.
  • Logs the incoming data in the WCF web requests.
Trace: More detail, mostly large data, is logged.

Log files are usually archived for 30 days.

The logger uses the NLog logging platform; see http://nlog-project.org/. For more details about the configuration file, see https://github.com/nlog/NLog/wiki/Configuration-file.

Copy
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">