User Session Service

Important

This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

In Microsoft Dynamics AX, the user session service returns information about the calling user such as the user’s default language, default company, default company time zone, and so on. The user session service is:

  • automatically installed

  • by default, hosted by the Application Object Server (AOS)

  • always available

  • a Windows Communication Foundation (WCF) service that adheres to WCF protocols and standards

How the User Session Service Works

The user session service has two service operations:

  • GetAccessRights – returns an AccessRight array that contains the permissions that the calling user has to a specified access controlled item. For example, you can use this service operation to return the permissions that the calling user has to menus, tables, and so on.

  • GetUserSessionInfo - returns a UserSessionInfo class. This class contains properties that return the actual user information for the current user as shown in the following table.

Property

Description

AXLanguage

Returns a string that specifies the user’s default language as defined in the User options form.

Company

Returns a string that specifies the user’s default company as defined in the User options form.

CompanyTimeZone

Returns a TimeZone class that specifies the time zone for the user’s default company as defined in the User options form. The company time zone is in the Company information form.

CurrencyInfo

Returns a ICurrencyInfo class that specifies the default currency code associated with the user’s default company as defined in the User options form. The company currency code is in the Ledger form.

UserPreferredCalendar

Returns a PreferredCalendar class that specifies the user’s preferred calendar as defined in the User options form. In the User options form, the User preferred calendar field is only visible if the user’s language is set to Arabic.

UserPreferredTimeZone

Returns a TimeZone class that specifies the time zone for the user as defined in the User options form.

User Session Service Architecture

The user session service is a Windows Communication Foundation (WCF) service that is contained in the Microsoft.Dynamics.AX.Services.Metadata.Service.dll assembly. This assembly is located in the server Bin directory. Depending on your configuration, the assembly is located in a directory such as C:\Program Files\Microsoft Dynamics AX\<version>\Server\MicrosoftDynamicsAX\Bin.

The user session service has the following configuration default values:

  • It is hosted by the AOS on port 8201 and the URL is net.tcp://<servername>:8201/DynamicsAx/Services/UserSessionService.

  • The service WSDL URL is http://<servername>:8101/DynamicsAx/Services/UserSessionService

  • It uses the netTcpBinding binding.

These settings will vary depending on what port number the service port and the WSDL port have been configured to use.

The service configuration settings are found in the Ax32Serv.exe.config file which is also located in the server Bin directory.

The user session service returns session information for only the user calling the service. The service retrieves the current user as defined in Windows. The service returns the default company, company time zone, and default currency for the user’s default company as specified in the User options form. You can open this form by navigating to Administration > Places > Users and clicking Options. The company information for the default company is found on the Legal entities form. You can open this form by navigating to Basic > Setup > Organization > Legal entities. Currency information for the default company is found on the Ledger form. You can open this form by navigating to General ledger > Setup > Ledger.

See also

Walkthrough: Calling the User Session Service

AIF System Services