Implementation Guide For Commerce Data Exchange - AX 2012
Implementation Guide For Commerce Data Exchange - AX 2012
http://www.microsoft.com/dynamics/ax
Table of Contents
Introduction ................................................................................................ 4
Subcomponent Description
Synch Service Synch Service (DBServer.exe) is the data replication service. It handles
data transfer between Retail databases at the head office and in the
stores.
Synch Service Settings Synch Service Settings (DBServerUtil.exe) is the configuration utility for
Synch Service. It starts the Synch Service Settings Wizard, where you
can enter information to configure an instance of Synch Service.
Synch Service Pack Viewer Pack Viewer (DDPackView.exe) is a tool for inspecting the data included
in the packages that Synch Service sends and receives.
Store Environment
Dynamics AX Headquarter Environment
Synch
Service
Synch
Service
POS Terminal
Real-time
Service
Web Store Environment
Communications
Synch
AOS Service
CRT Database
Web Store/CRT
Implementation planning
For information about planning, see the Microsoft Dynamics AX 2012 Implementation Planning Guide,
which provides guidance to system architects, consultants, and IT professionals involved with planning
a Microsoft Dynamics AX 2012 implementation. Topics include the Microsoft Dynamics AX 2012
architecture, implementation methodology, and hardware and software requirements and planning.
This document includes information for Microsoft Dynamics AX 2012 R2.
3. Under Install, click Microsoft Dynamics AX components to select the components to install.
The Microsoft Dynamics AX 2012 Setup wizard opens.
6. The next page provides options for adding and modifying components, and for removing
components. Select Add or modify components, and then click Next.
8. Prerequisite validation runs and checks that all the dependencies for installing the selected
components are met. If any errors are displayed, click the link to download and install the
prerequisites.
10
If you select the Configure Synch Service check box, you are required to create a message
database for Synch Service and specify an account to run it. Otherwise, you can use the Synch
Service Settings tool to do this after installation.
10. Enter information in the following fields.
Field Description
Server name The computer that hosts the SQL Server instance on which the Synch Service
message database is created.
Database name The name of the message database for Synch Service.
11
12
When you start the tool, the following dialog box opens.
13
Control Description
Server Name The service instance that you are configuring.
Add Create a new instance by using the name entered in the Server Name field.
All Servers Display all existing service instances on the local computer. Select an instance to
configure it.
3. In the Server name field, enter the name of the computer that hosts the SQL Server instance on
which the Synch Service message database is created. In the Database name field, enter the
name of the Synch Service message database. Then click OK to create the message database.
The following dialog box opens.
14
Control Description
Server Name The name of the selected service instance. This is a read-only field.
Packet Owner The name of the service that creates the data packages. This setting is
available only if 2nd Stage Commerce Data Exchange Synch Service
is selected in the Server Mode field.
Server Mode The mode that this instance of Synch Service is running in. If this instance
is a primary instance, select Commerce Data Exchange: Synch
Service.
If this instance is a forwarder instance, select 2nd Stage Commerce
Data Exchange Synch Service. For more information about forwarder
mode, see the Set up a forwarder instance of Synch Service section.
Server Port The listening port for Synch Service. This setting is not available for a
forwarder instance, because in that case, the service only forwards
packages. If you plan to run more than one instance of the service on the
same computer, you must change the port values so that they do not
conflict with other services.
Off Turn the server listening port on or off. (We do not recommend that you
turn the port off.)
Telnet Port The port used by the Synch Service Telnet interface. This feature lets you
use Telnet to monitor the status of Synch Service. If you also run a Telnet
server on the computer, assign the Synch Service Telnet interface to
another port to avoid conflicts.
15
4. Configure the Synch Service connection, and how incoming and outgoing messages are handled.
On this page, you need to specify the path of the working directory that keeps temporary files.
This directory keeps queue files by default, and it keeps data package files if you select the Keep
Package Files check box in the Server debugging properties window.
Note: In the Working Directory field, %s typically corresponds to the directory
C:\Users\<username>\AppData\Local.
The following table describes the fields that are available.
Field Description
Server Name The name of the service instance that you are configuring.
Working Directory The path of the folder where Synch Service keeps temporary files and, if it
is configured to do so, package files. To change this path, click Browse.
Days Messages Exist The number of days to keep processed incoming or outgoing messages. If
you type a value of 0 in this field, messages are not deleted.
Timer Interval The interval at which Synch Service checks for packages that must be
reprocessed because of communication errors.
Limit Job Process (cnt) The maximum number of job records that Synch Service processes per
connection. The number should be set lower when the average package
size is high and higher when the average package size is low. To disable
the feature (not recommended), enter a value of 0.
This feature guarantees that Synch Service continues processing, even if
it has a heavy load that would typically cause it to stop responding. Also,
when this feature is on, if the first job record in the batch has an error,
the rest of the packages are skipped for the run.
16
Field Description
Server Name The name of the service instance that you are configuring.
Hold Connections The number of connections to the source database that Synch Service
should reserve.
Idle Conn. Time The number of idle minutes before the reserved connections time out and
are released.
Thread Timeout The number of seconds before threads used in connections to remote
locations time out.
Max. Forw. Threads The maximum number of threads that can be used concurrently to send
packages.
Max Hop Counter The maximum number of transfers, per package, between instances of
Synch Service. This setting prevents infinite loops that can result from a
misconfigured Synch Service instance.
Socket Timeout The number of seconds that Synch Service waits for the network to finish
a particular send or receive operation. To prevent Synch Service from
shutting down merely because it is waiting for the network, set this value
lower than the value in the Thread Timeout field.
Maximum retries The number of attempts before Synch Service stops trying to perform an
operation on a package.
Forw. Attempts The maximum number of attempts that Synch Service makes to forward a
packet. This setting works only on a forwarder instance.
Use Processor The processor that the service should run on. If you want the operating
system to allocate processors based on need, select All Processors.
17
Field Description
Server Name The name of the service instance that you are configuring.
Keep Package Files A selected check box indicates that Synch Service does not delete the
temporary package files in the working directory. Do not leave this feature
enabled for long, because it could cause you to run out of disk space and
prevent Synch Service from operating correctly.
Exception Dump A selected check box indicates that a memory dump file is created if Synch
Service stops working suddenly.
Log/Dump Dir The folder where log files are saved. Confirm that the folder that you specify
actually exists.
18
Write to Windows event log A selected check box indicates that Synch Service writes the logging data to
the Windows event log.
Max Lines / Logfile The maximum number of lines in each log file. Synch Service creates three
log files, rotating to the next log file when the maximum number of lines has
been reached. On startup, Synch Service makes a copy of the old log files by
appending .old to their names. This means that if the service has been set to
automatically restart on failure, the failure appears in the old log files.
Log Level The amount of error logging that takes place. Generally, the Error and Main
logging levels are sufficient, but greater detail might be helpful in some
cases. The following levels are available:
Error – All errors reported from Synch Service are logged.
Main – The main operations in Synch Service are logged.
Actions – Detailed information about operations in Synch Service is
logged.
Detail – Very detailed information about operations in Synch Service is
logged.
Functions – Highly detailed and technical information about operations in
Synch Service is logged. (This option is intended for developer use only.)
Important: Logging as specified in the Log Level settings can take place
only if the Log Mode check box is selected.
19
The forwarder instance handles communication in only one direction, from the head office to the store
locations.
The name that you assign to the forwarder is the name that you use in the Database profiles form
to indicate which forwarder should handle a particular location. Use the following procedure to
configure a forwarder instance.
In Microsoft Dynamics AX, follow these steps:
1. Open the Synch Service Profiles form. (Click Retail > Setup > Retail scheduler > Channel
integration > Commerce Data Exchange: Synch Service profiles.)
2. Create a new profile, specifying the Service name value in the following format:
<Forwarder service name>;<receiver service name>
This causes the forwarder to send packages to the listed receiver location.
3. Open the Database profiles form. (Click Retail > Setup > Retail scheduler > Channel
integration > Database profiles.)
4. In the Database profiles form for any store, in the Commerce Data Exchange: Synch Service
list, select the newly created profile.
5. Confirm that the user that Synch Service is running as has read/write permissions to the working
directory and its contents.
The following screenshot shows a sample profile setup for a forwarder in Microsoft Dynamics AX.
Note: The format of the Service name value is <Forwarder service name>;<Receiver service
name>.
20
2. In the Service account dialog box, specify an account for running this Synch Service instance.
21
22
7. Specify a log/dump directory, and select any other options that are needed.
23
In Microsoft Dynamics AX, configure the following profiles for each instance of Synch Service:
A Synch Service profile (Retail > Setup > Retail scheduler > Channel integration >
Commerce Data Exchange: Synch Service profiles)
An AOS profile (Retail > Setup > Retail scheduler > Channel integration > AOS profiles).
For each AOS profile, select a different Synch Service instance. The AOS profiles can use the same
AOS instance.
Next, create new distribution schedules (Retail > Periodic > Data distribution > Distribution
schedule). For example, create a distribution schedule to send items and prices to stores on the west
coast. Select a new AOS profile and select the distribution location list that represents stores on the
west coast. Add the A-1040 (products) and A-1020 (discounts) jobs to the distribution schedule.
Repeat this step for other regions.
24
Pack Viewer converts the package file from binary format into XML files that you can open in Notepad
or another text editor. There is one XML file for the header and one for each table included in the
package. The files are stored in a folder with the same name as the package.
Package files are available for viewing only if you specify in Synch Service Settings that they should be
saved.
Although you can save all packages as a message archive, doing so can consume disk space quickly.
Typically, you save packages and use Pack Viewer only as a troubleshooting measure, such as when
you are experiencing a synchronization or replication issue.
25
26
27
3. Enter the subjob number, which is a unique ID that identifies the subjob.
4. Enter a description of the subjob.
28
29
3. Select the from field in the list. The field type is automatically selected based on the field
selection.
4. Select the to field in the list. The field type is automatically selected based on the field selection.
5. Select the conversion type in the list. The following options are available:
None – Select this option to apply no conversion rules.
Equals (=) – Select this option to specify the filter value in the Value field.
Substring – Enter the substring value in the Value field.
Today() – Select this option if the filter is based on the current date timestamp.
TimeNow() – Select this option to populate the current time.
Skip text conversion – Select this option to skip the conversion process.
Time to integer – Select this option to convert a time value to an integer.
Integer to time – Select this option to convert an integer to a time value.
30
Scheduled by information
1. Open the scheduler subjob by clicking Retail > Setup > Retail scheduler > Scheduler subjob.
2. Select the subjob in the list on the left, and then click Scheduled by to view the scheduler job
that runs the subjob.
The Scheduled by form opens.
31
32
33
Distribution locations
A distribution location is a record that represents the destination for distributed data. Whenever you
create a store, a corresponding distribution location is automatically created. In general, you must
have a distribution location for each store location that has its own database.
34
35
3. Click Add to add a new retail channel to the distribution location list.
4. Select the location number in the list.
Distribution schedule
The distribution schedule links distribution locations lists (where to send the data) with scheduler jobs
(which data to send). You can run a distribution schedule manually or you can configure a Microsoft
Dynamics AX batch job to run periodically.
1. Click Retail > Periodic > Data distribution > Distribution schedule.
36
2. In the Filter on action creations form, click New to create a new action filter.
3. Select a table in the list on the left.
4. On the Field FastTab, add fields to the list. Preactions are created only for fields in this list. If
another field in the table is updated, no preaction is created.
Table distribution
The table distribution specifies how changes that are made to data are distributed from Microsoft
Dynamics AX to channel locations. To use action jobs correctly, you must configure the table
distribution.
37
Parent/child relationships
If you use a table distribution to establish a parent/child relationship between two tables, you must
complete both of the following tasks:
For the child table, set up table links to describe the relationship between the child table and its
parent table. For more information, see the Set up table links section.
For the parent table, specify the types of actions (insert, update, or delete) that cause any child
tables to be distributed together with the parent table. These linked settings also include any
linked child tables of the child tables.
38
The Record ID field is automatically populated based on the assigned number sequence.
4. Select the table ID in the window that opens. The Table name field displays the name of the
selected table.
5. Select the distribution type in the list. The following options are available:
All distribution locations
Same as parent distribution
By distribution group
No distribution
The Parent to another table check box is automatically selected if the table that is selected as
parent table is also the parent of other tables.
The Table links check box indicates whether a parent/child link has been generated between the
two tables. The table link must be created if the distribution type that is selected is the same as
the parent distribution.
The No actions check box is selected to indicate that no action is required for changes that occur
to the selected table. If you want to use no actions, the parent table must be empty or set to 0
(zero).
6. Select the Linked actions on insert check box to indicate that the distribution occurs when new
records are created in the selected table.
7. Select the Linked actions on update check box to indicate that the distribution occurs when
existing records are updated in the selected table.
8. Select the Linked actions on delete check box to indicate that the distribution occurs when a
record is deleted.
39
40
41
42
43
44
2. Click New to create a new database profile. Optionally, you can click Duplicate to create a new
profile based on a currently selected profile.
3. Enter the following information:
Name – Type a name for the profile.
Server name – Type the name of the database server.
Database name – Type the name of the database.
Encrypt database connection – Select this check box to encrypt the database connection.
Commerce Data Exchange: Synch Service – Select the profile for the correct instance of
Synch Service.
4. Click Test connection to confirm that the connection string for the selected database profile is
correct.
45
If you want to use this new table with action scheduler jobs, add the following code snippet to the
insert, update, and delete methods, and add it to the filter on action list.
super();
if (replicate)
{
RetailConnActionManagement::createActions(this, RetailConnActionUpdate::Insert);
}
46
4. Click Location fields, and then add the fields that you defined in the POS database.
Note: The Type and Length fields have been deprecated and can be ignored. Only the field
names matter.
47
48
You have now completed the setup and configuration to send TestTable01 data to the POS database.
You can then enter data into the TestTable01 table and run the scheduler job to verify that data can
be sent successfully to the POS database.
49
Log files
The Synch Service creates two types of log files. By default, log files are stored in the following folder:
C:\Users\<service user account>\AppData\Local\Microsoft Dynamics AX\60\Commerce Data
Exchange\Synch Service\<service name>\logs
The first log file contains information about regular processing tasks of the Synch Service and is
named <InstanceName>-SC-[X].log, where X is an integer between 1 and 3. When you restart an
instance of Synch Service, the log file is renamed <SnstanceName>-SC-[X].old.log.
Logging and the output location (file or Windows Event log) are configured in Synch Service settings.
The second log file contains error messages for the Synch Service message upload and is named
<InstanceName>-SCMonitoring.log.
The following screenshot is an example of how these files look. Files with the .dmp extension are
memory dump files.
Field Description
PackageNo A sequential package number.
50
Status To find out the meaning of a status, open the AOT in Microsoft Dynamics
AX, and locate the RetailConnSCMonIncomingMessages or
RetailConnSCMonOutgoingMessages table. Right-click the Status field,
and then click Add-Ins > Open new window > Open used enum.
Received = 0
Processed = 1
Error = 2
Waiting = 4
No data = 5
Pending forward = 7
To forward = 8
Forwarded = 9
OutgoingMessages
Field Description
PackageNo A sequential package number.
DestServerName The name of the server where the destination instance of Synch Service is
running.
Forwarder The name of the instance of Synch Service that will forward the data
package. By default, the forwarder name is the same as the service
name.
Status To find out the meaning of a status, open the AOT in Microsoft Dynamics
AX, and locate the RetailConnSCMonIncomingMessages or
RetailConnSCMonOutgoingMessages table. Right-click the Status field,
and then click Add-Ins > Open new window > Open used enum.
Received = 0
Processed = 1
Error = 2
Waiting = 4
No data = 5
Pending forward = 7
To forward = 8
Forwarded = 9
TryCount The number of times the system has attempted to process the message.
CancelledByUser If a scheduler job encounters an error during processing, set this flag to 1
to skip the remaining retries.
51
Error codes
When a communication issue occurs, an error is returned by Synch Service. You can view Synch
Service errors in the following three places in Microsoft Dynamics AX:
When you are testing the connection for a distribution location, in the Infolog
In the Scheduler job form (Click Retail > Setup > Retail scheduler > Scheduler job.)
In the message database for each instance of Synch Service
52
4098 Canceled because of send and receive size Resend the package by running the Retail
The registered size of the package does Scheduler job again.
not match the actual size of the package.
This is most likely caused by a
transmission failure.
4099 Cannot find new packet number Confirm that the message database is
Synch Service could not assign a new configured correctly, and that the Synch
package number to an incoming package. Service user has the required privileges.
This is usually caused by an incorrect
message database configuration in Synch
Service Settings for the receiving instance
of Synch Service.
4100 Cannot instance a socket Confirm that the TCP/IP protocol is installed
The operating system could not create a and enabled on the computer. For more
Windows TCP/IP socket. TCP/IP might not information about enabling TCP/IP, see
be installed or enabled on the computer. “Enable remote connections in SQL Server
and start the server” in “Deploy Microsoft
SQL Server” in the Deployment and
Installation Guide.
4102 HopCount has exceeded its maximum Verify the DNS registration of the server
value name or its entry in the Hosts files on all
A package cannot be transferred, because computers involved.
the hop counter for the package has Confirm that the distribution server name
reached the maximum that was set in for the location (Retail scheduler > Setup
Synch Service Settings. > Channel integration > Commerce
This error can occur when a service name Data Exchange: Synch Service profiles)
is incorrectly assigned to an IP address. It matches the one in Synch Service Settings.
can also be caused by an inconsistency
between the distribution server name for a
location and the actual server name for
the instance of Synch Service.
53
12288 An error occurred connecting to Synch Start the Synch Service service.
Service Confirm that the Synch Service service
The Data Client component of Microsoft name has an IP address associated with it.
Dynamics AX cannot connect to Synch This can be checked from a command
Service. This error occurs when the Synch prompt by typing ping <Synch Service
Service service is not running, when the computer name>. If the service name
Data Client is trying to connect to a does not respond to a ping command, you
service that does not exist or does not must reconfigure your DNS server or Hosts
have a correct IP address associated with file so that the service name is associated
it, or when the Data Client is trying to with the correct IP address.
connect to Synch Service on an invalid Verify that the port numbers match in
TCP/IP port. Synch Service Settings and in the Synch
Service profile.
Verify that IPsec (if enabled) or the firewall
is configured correctly. One way to verify
this is to connect to the Synch Service port
by using Telnet.
12289 The connection string was empty In Retail Scheduler, verify that the
The connection string for the location has database profile is configured correctly.
not been provided.
12291 Connection temporarily unavailable Wait until Synch Service has released one
All sessions (servers) that Synch Service of the sessions that it is using, or assign
is allowed to use are unavailable. more sessions to Synch Service in Synch
Service Settings.
12293 Cannot load plugin dll Uninstall and reinstall the plug-in to correct
In most cases when this error occurs, the the registry setting.
plug-in has been registered, and the Remove the Synch Service server, and then
configuration is correct, but the path to add it again.
the plug-in .dll file is invalid, or the .dll file
is missing.
12294 Plugin version not supported Upgrade Synch Service to the same version
This version of the plug-in cannot be used as the plug-in.
with this version of Synch Service. In Install the version of the plug-in that
most cases, the plug-in requires a newer matches the version of Synch Service.
version of Synch Service.
12295 Waiting for a previous package Take corrective action so that the package
A previous package belonging to the same is processed successfully.
JobID has not been processed Cancel the job.
successfully. Check the job status to
determine whether the job is waiting, or
whether there is an issue with the job.
54
16386 Error reading file Re-create the file by running the job again.
Synch Service was trying to read a file
that does not exist.
55
56
Retail POS and Commerce Runtime can perform most operations without connectivity to Microsoft
Dynamics AX. However, for certain scenarios, both need to retrieve or update data directly in
Microsoft Dynamics AX.
57
Depending on the certificate authority, you will install the certificate through either using the
certificate request in Internet Information Services Manager or import the certificate from a pfx file
using the Microsoft Management Console.
1. Open the Microsoft Management Console with administrator privileges. (Click Start > mmc.exe,
right-click, and then click Run as Administrator.)
2. Click File > Add/Remove Snap-in, select Certificates, and then select Local Computer.
58
3. In the certificate manager console, right-click Personal, and then click All Tasks > Import. The
Certificate Import Wizard opens.
4. Follow the Certificate Import Wizard to finish importing the certificate. Make sure that you import
the private key, which is needed for channel encryption.
5. Under Personal > Certificates, browse and locate the server certificate. Right-click the
certificate, and then click All Tasks > Manage private keys. The certificate security dialog box
opens.
59
7. Under Personal > Certificates, browse and locate the server certificate. Double-click the
certificate to open the certificate properties dialog box.
8. On the Details tab, select Thumbprint.
The thumbprint is the 20-byte array that is displayed. Copy the value, removing all the spaces.
For example, the thumbprint for the certificate in the preceding screenshot is
6b3b49dfad6100a47ef623c8e471c567bf052530.
You need the thumbprint for the service installation.
60
Property Description
User account The domain\user for the domain account for Real-time Service.
Note: This account needs to be a Microsoft Dynamics AX account that has
sufficient privileges to perform all the necessary retail tasks.
Service binary source folder The service binary folder, where the web.config and service files are
path located. For the default MSI install, this folder should be something like
%ProgramFiles%\Microsoft Dynamics AX\6.2\Commerce Data
Exchange\Real-time Services\6.2.
The installation scripts then install Real-time Service with all the required dependency
components. If the installation is completed successfully, you see output like the following.
61
62
Field Description
Server The server host name
Port The port to use for communication. For net.tcp, the default port is 808.
For http, the default port is 9081.
63
Common name The server certificate common name. You can find this at Start >
mmc.exe > Personal > Certificates, in the Issued To column.
Passphrase The passphrase that is used for Microsoft Dynamics AX to verify that a
POS terminal is a valid terminal.
Language The language used to return error message from Real-time Service.
Real-time Service version The Real-time Service version to use. Use the default (Microsoft Dynamics
AX 2012 R2) unless you are working with N-1 support.
64
After you have selected a Real-time Service profile, run the Synch Service job A-1090 Registers.
65
date System.DateTime
int System.Int32
int64 System.Int64
str System.String
guid System.Guid
66
if (dirPartyTable)
{
result = [true, 'Success!', strFmt("Hello %1 !", dirPartyTable.Name)];
}
else
{
result = [false, 'Customer not found'];
}
}
else
{
result = [false, 'accountNumber is null.'];
}
return result;
}
2. Select Local client, and then click Manage > Create configuration.
68
69
8. Select the Enable user breakpoints to debug code in the Business Connector check box.
Again, you can leave the license code fields blank.
70
11. Create a new string value with the name debug_across_os_session and a value of 1.
71
72
Example
The example in this section is based on the following assumptions:
You have a Retail system on Microsoft Dynamics AX 2009 that has one store (S0001) with one
terminal (T001).
The distribution location of the terminal is T001.
Database profile TestDB5Profile is pointing to the database that is being used by this terminal.
The Retail Store Connect profile name that is used by this store is TestStoreConnect5Profile, and it
is assigned to TestDB5Profile.
The Retail Transaction Service profile assigned to this terminal is TestTS5Profile.
The AOS profile name used in the scenario is TestAOSProfile.
Goal
After the Microsoft Dynamics AX upgrade is completed, you can still use the older version of the
software in the store without change, and you can also work with the upgraded Microsoft Dynamics AX
2012 R2 Retail system.
73
74
The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the
date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a
commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of
publication.
This white paper is for informational purposes only. Microsoft makes no warranties, express or implied, in this document.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of
this document may be reproduced, stored in, or introduced into a retrieval system, or transmitted in any form or by any means
(electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of
Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject
matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this
document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted
herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person,
place, or event is intended or should be inferred.
Microsoft, Microsoft Dynamics, the Microsoft Dynamics logo, MSDN, SharePoint, SQL Server, Visual Studio, Windows, Windows
PowerShell, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States
and/or other countries.
75