System Architect
Generic MS Dynamics AX System Architecture
According to the application, we can always write a custom web application to interact with Dynamics AX through an Application Object Server (AOS). The AOS Architecture can be checked in the following section.
AOS – Application Object Server
An Application Object Server (AOS) instance is a core component of your Microsoft Dynamics AX installation and is installed by using Setup. An AOS instance enforces security, manages connections between clients and the database, and provides the foundation where Microsoft Dynamics AX business logic runs. The topics in this section describe the various roles in which AOS can function.
How Beehexa build Custom API for Dynamics AX 2012
AOS System Architecture Overview
In Microsoft Dynamics AX, there is a 3-tier infrastructure with a database server, an application object server (AOS), and a client. The database server contains the table data. The AOS is used to execute application objects, such as queries and classes. Application objects in the user interface, such as forms and reports, run on the client computer. This topic describes how to develop an application using the different tiers and how record buffers are related to the tiers.
We can use the above architecture to build a custom Web API for MS Dynamics AX.
The Web API will be the Tier One above to interact with the Database through Application Object Server with custom X++ source code.
What is MorphX?
MorphX is the integrated development environment (IDE) in Microsoft Dynamics AX. It includes tools for designing, editing, compiling, and debugging code in Microsoft Dynamics AX.
Using MorphX with custom X++ source code, we can build any custom Client Application to interact with Microsoft Dynamics DB through AOS.
The Client Application here can be a Web API.
What is X++ Programming Language?
X++ is an object-oriented language with similarities to C#. X++ is part of the MorphX development platform that you use to construct accounting and business management systems.
Basic ASP.Net Web API Architecture
According to MS tutorial here, we can build a simple web rest API as described below:
A simple API Endpoint can look like below
using DynamicsAX2012Api.Helper;
using System;
using System.Net.Http;
using System.Web.Http;
namespace DynamicsAX2012Api.Controllers
{
public class HomeController : ApiController
{
[HttpGet]
public HttpResponseMessage Index()
{
var response = new HttpResponseMessage();
response.Content = new StringContent(@"
HexaSync Integration Platform for Connecting ERP, POS, CRM, Accounting, and eCommerce Applications to Transform Business", System.Text.Encoding.UTF8, "text/html");
return response;
}
}
}
Dynamics AX Custom Web API Architecture
There are two main components to build the Custom Web API to work with MS Dynamics AX.
- Custom ASP.Net Web API to run on IIS Web Server
- The ASP.Net Web API must have the .Net Business Connector package installed.
- Custom X++ Source Code to deploy on Application Object Server using MorphX
References
- https://learn.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/system-architecture
- https://learn.microsoft.com/en-us/aspnet/web-api/overview/older-versions/build-restful-apis-with-aspnet-web-api
- https://learn.microsoft.com/en-us/aspnet/whitepapers/aspnet-and-web-tools-20122-release-notes
- https://devblogs.microsoft.com/dotnet/list-of-asp-net-web-api-and-httpclient-samples
- https://learn.microsoft.com/en-us/dynamicsax-2012/developer/microsoft-dynamics-ax-ide
- https://learn.microsoft.com/en-us/dynamicsax-2012/developer/x-language-programming-guide
- https://learn.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/large-scale-deployment