AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 31.12.2012, 11:13   #1  
Blog bot is offline
Blog bot
Участник
 
25,640 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: AX for Retail 2012 R2: Troubleshooting the Real-time Service
Источник: http://blogs.msdn.com/b/axsupport/ar...e-service.aspx
==============

This is a follow-up from my previous post AX for Retail 2012 R2: Installing the Real-time Service and should give you some tips if you run into problems installing and configuring the Real-time Service.  Before getting into those tips, I want to go through the configuration of logging, as that will be necessary for your troubleshooting.

 

Configuring Real-time Service Tracing and Logging

The Real-time Service has robust tracing and logging that is easy to configure.  Even if you have no problems getting the service up and running, there will be times where you need to dig into POS errors.  Remember that the Real-time Service is a conduit between the POS and the X++ logic that is running in AX.  When errors happen in the X++ code, the POS will often display and log a rather generic error.  Getting to the root of the issue usually requires digging into the X++ errors.  These are logged by the Real-time Service itself.

Configuration of the Real-time Service logging happens in the web.config file for the Web service.  If you installed the service with the Powershell script, this will be in the c:\inetpub\dynamicsaxretail\CommerceDataExchangeRealtimeService\ folder.  Load the web.config file into any text editor and note these two lines (they should be lines 14 and 28 by default):




The easiest way to trace what is happening in the Real-time Service is by using the RollingXmlWriterTraceListener.  This is a common log format that is also used by other components of AX for Retail. 
Line 14:  The value in the switchValue property is the level of tracing.  Common levels that I like to use include “All”, “Warning”, and “Error”.  Note:  these values are case-sensitive.  If you spell it incorrectly, your Real-time Service will immediately break when you save the web.config file!

Line 28:  The value of the initializeData is where you can specify a folder to which the log file will be written.  If this property is left blank it can be difficult to find the file as it will be stored in the \temp\RetailLogs folder.  I like to save the file somewhere easier to find like c:\logs.

Once you have logging configured, you should start to see log files being generated:

 



 

Note that the filenames include the Process Name and Process ID.

Although the files are standard XML files, they are messy to read in an XML viewer.  Instead, you should use a small program called “MICROSOFT Service Trace Viewer” (SvcTraceViewer.exe) which is a standard tool for reading these types of log files.  That program expects extensions of “.svclog” but you can do a File > Open to open the XML files.  Once loaded, click on the “Activity” section on the left and then you will see all of the messages on the right, very similar to how they would appear in Event Viewer:



 

Depending on your trace level, these messages will also include exceptions and warnings from X++ methods that the service is calling.

Here is a good blog post on installing SvcTraceViewer.  It can be a bit tricky to get ahold of since you need to pull it from the Windows SDK, but once you find it you can just copy the .exe to any machine and run it directly.

 

Common Install and Configuration Issues

 

Problem:  The InstallCommerceDataExchangeRealtimeService Powershell script fails with an error “PathNotFound” on the web.config file:



Solution:  The most common reason for this failure is by not specifying a valid ServiceBinarySourceFolder parameter when running the script.  Most often, a trailing “\bin” is added.  The correct path should be:  “c:\Program Files (x86)\Microsoft Dynamics AX\60\Commerce Data Exchange\Real-time Services\6.2\”.  You should run the uninstall script and then re-run the install script with the correct parameter.

 

Problem:  When testing the WCF application in the Web browser you see this error:  Invalid hexadecimal string format



Solution:  Verify that you entered the Thumbprint for your server certificate correctly.  It should be 40 characters with no spaces.  It is also very susceptible to copy and paste issues (hidden characters, ascii/unicode character sets, etc.) so it may be helpful to type it in manually.  The thumbprint is stored in the web.config file in the node, but it may be best to run the uninstall and install using the Powershell script if you need to change it.

 

 

Problem:  When testing the WCF application in the Web browser you see this error:  Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding.  Registered base address schemes are [http,https].



 Solution:  We have seen a couple instances where the net.tcp binding may not get created by the Powershell installation script.  In the IIS Manager, go to your CommerceDataExchangeRealtimServiceWebsite note and right-click and select bindings



Verify that net.tcp is included with binding information of 808:*.

Under the application itself (CommerceDataExchangeRealtimeService), right-click and select Manage Application > Advanced Settings.  Verify that net.tcp is included:



 

Problem:  Call to the Real-time Service results in an error similar to (POS error log):  System.IdentityModel.Tokens.SecurityTokenValidationException: The X.509 certificate CN=TSServerCert chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority.



Solution:  One of the more difficult tasks in configuring the Real-time Service is getting your Server Certificate set up correctly.  If you are creating a test environment it is very likely that you are using a test or self-signed certificate.  If this is the case, all clients attempting to connect to the Real-time Service (i.e. your POS machines) need to create a trust chain with that server.  This step is not needed if you are using a purchased certificate because the publisher of that certificate is already a trusted authority.

If you find yourself in this situation, you can run the InstallCertificationAuthority Powershell script that is included with the Real-time Service installation.  You will need a .cer file (certification authority) and a .crl (revocation list) to run the script.

 

 

Problem:  Call to the Real-time Service results in one of these errors (POS error log):  TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond :808 or TCP error code 10061: No connection could be made because the target machine actively refused it 10.11.12.13:808

Solution:  In the Services console on the Real-time Server machine, verify that Net.Tcp Listener Adapter and Net.Tcp Port Sharing Service services are running.

 

 

Problem:  Call to the Real-time Service results in an error similar to: Exception: The requested service, 'net.tcp://localhost/RetailTransactionService/Service.svc/Common' could not be activated. See the server's diagnostic trace logs for more information. [CryptographicException: Keyset does not exist]

Solution:  This can occur if the user account that the Real-time Service is running under does not have access to the server certificate private key.  In IIS management console, first identify the identity for the CommerceDataExchangeRealtimeServiceAppPool application pool.  Open the Certificate Manager console (start –> type in mmc, add the snap-in for certificate manager, local machine).  Expand Personal –> Certificates node.  Right click on the certificate, choose All tasks -> Manage private key...  Add read access for the user identified above.



 

Problem:  Call to the Real-time Service results in an error similar to:  Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Solution:  This can happen if the .Net Framework 4.0 gets unregistered from IIS for some reason. This registration should occur with the installation of the Real-time Service, but you can run the following command in an elevated command prompt to manually register:  %WINDIR%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i





Problem:  Call to the Real-time Service results in an error similar to the following (POS error log):  RetailPosis.TransactionServices.EstablishConnection: System.ServiceModel.Security.MessageSecurityException: Identity check failed for outgoing message. The expected DNS identity of the remote endpoint was 'TSServerCertX' but the remote endpoint provided DNS claim 'TSServerCert'. If this is a legitimate remote endpoint, you can fix the problem by explicitly specifying DNS identity 'TSServerCert' as the Identity property of EndpointAddress when creating channel proxy.

Solution: In HQ, verify that the Common Name on the Real-time Service profile your POS is using matches the Common Name of your server certificate:



 

Problem:  Call to the Real-time Service results in an error similar to the following (POS error log):  Inventory lookup: LSRetailPosis.PosisException ---> System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: An error occurred when processing the security tokens in the message. In addition, an error similar to the following is found in the Real-time Service log:  Username password validation failed: The password is null or whitespace

Solution:  In HQ, verify that you have entered a value in the Passphrase field of the Real-time Service profile.  Note that the field may look populated with the mask character (dots) even if you have not entered one.  You do not have to enter this passphrase anywhere else as it gets pushed to the POS database via the N-1090 job.  See Brett’s article for more information about how the Passphrase field works:  Unable to connect to the Transaction Service - The case of the missing or mismatched passphrase.

 

 

Problem:  The POS cannot connect to the Real-time Service and the Real-time Service log has an error similar to the following:  Axapta.Logon() failed. Exception details: The server is unavailable. Microsoft Dynamics will try to connect to other servers in your configuration.Microsoft.Dynamics.BusinessConnectorNet.ServerUnavailableException:

Solution:  There are a number of possibilities here.  First, if you have overridden the AOS connection in the Real-time Service’s web.config, make sure that it is pointing to a valid AOS.  Also, make sure that this AOS is up and running.  Finally, verify that the Real-time Service user account (In IIS management console, identify the identity for the CommerceDataExchangeRealtimeServiceAppPool application pool) is a valid AX user that has rights to connect via the .Net Business Connector.



 



Hopefully these tips will get you up and running with the Real-time Service and able to track down issues when the POS errors don’t give you enough information.  As always, if you get stuck, please open a support incident and we can help you out.




Источник: http://blogs.msdn.com/b/axsupport/ar...e-service.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
amer-ax: It was a great day! Blog bot DAX Blogs 3 29.12.2012 01:02
emeadaxsupport: AX for Retail 2012 R2: Installing the Real-time Service Blog bot DAX Blogs 0 19.12.2012 11:11
DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates? Blog bot DAX Blogs 0 03.12.2012 11:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 14:02.