Add New LS Central Function

When adding a new Web Function to LS Central and Commerce service should connect to it, the new function needs to be added to the 10033100 OmniWrapper codeunit for the Retail part, or to the 10015822 LSC Activity Web Services codeunit for the Activity part.

Commerce will refer to those two codeunits to consume LS Central Web Services. It is also possible to add a new codeunit with all customized functions, and then add Reference in Commerce Service to the new WS Codeunit.

  1. Open Server\WcfService\LSOmniService.sln
    (in some cases, you need to run Visual Studio as Admin to load Service Project).
  2. Open the BOConnection.PreCommon project:

  1. If your new WS Function was added to the OmniWrapper codeunit, click LSCentral Web Reference, change the Web Reference URL to OmniWrapper in your running LS Central instance where the new code is.
  2. Right-click LSCentral Web Reference, and select Update Web Reference from the menu.

If the new code was added in Activity codeunit, do this for LSActivity Web Reference.

If the code is in a new LS Central WS Codeunit, add a new Web Reference that points to the new WS Codeunit:

  1. Right-click the BOConncetion.PreCommon project, and select Add - Service References.
  2. Click the Advanced button, and then click the Add Web Reference button.
  3. Paste in the URL to the new Central WS Codeunit, and press the right arrow next to that field, then enter a descriptive Web reference name.

    Note: When updating or adding a new Web Reference, you must modify the Reference.cs file in the Web Reference data folder and change

    public partial class MyWSRef : System.Web.Services.Protocols.SoapHttpClientProtocol

    to

    public partial class MyWSRef : MySoapHttpClientProtocol

  4. Open the PreCommonBase.cs file, and add object for the new WS reference. You can just clone the code for other WS Reference objects that are there, like centralWS, and do same for your new object. It is fine to modify the Base file with this as it should not conflict with other updates later on.

  5. Open the PreCommonCustom.cs file, and you will now have access to your new function in the centralWS object or the new object you created. The same applies to any XML port that was added, it will be visible in LSCentral object.

Any mapping of data to or from the LS Central Web Service to a Commerce object would be done here, too.