AIF Document Services
In Microsoft Dynamics AX 2009, a new services model was introduced in Application Integration Framework (AIF). This model provides the ability to expose any class as a service that can be called from X++ or from an external system.
As part of these services, a set of services is included with Microsoft Dynamics AX that is based on documents (such as a sales order, a customer, and so on). These services use the existing Axd<Document> classes that are included with Microsoft Dynamics AX. This set of services is called document services.
In AIF, data is exchanged with external systems through business logic exposed as services. An exchange starts with a document service. The document service calls functionality in a document class which contains the Microsoft Dynamics AX business logic.
The service exposes service operations that can be called by an external system and take one or more documents as a parameter. The document is serialized into XML, and header information is added to create a message that can be transferred in to or out of Microsoft Dynamics AX.
XML Document Framework
The programmatic foundation of documents is the XML Document Framework. This framework consists of the classes that implement the business logic for individual documents in Microsoft Dynamics AX.
The XML Document Framework contains these types of classes:
Document service classes
Axd <Document> classes (also known as an Axd class)
Ax <Table> classes
In Microsoft Dynamics AX, all the data is stored in database tables and a close relationship exists between the data model and the way that data is manipulated through forms and presented in reports. Therefore, an application that exchanges data with Microsoft Dynamics AX would require a detailed understanding of the data model as well as any business logic applied in forms and reports in order to maintain data consistency and integrity.
To solve this problem, the document service classes expose service operations (create, delete, find, findKeys, read, and update) and provide an external application object interface. The document service classes represent data as business entities so that the calling application can exchange data with Microsoft Dynamics AX without any knowledge of the underlying tables. The document services call functionality in the Axd<Document> classes.
The Axd<Document> classes contain the business logic for related entities. For example, the AxdCustomer class contains the logic for creating, updating, and deleting customers and customer addresses.
The Ax<Table> classes are a further abstraction of a table and encapsulate the business logic associated with creation and modification of records in the database table. The Axd<Document> classes use the Ax<Table> classes to manipulate data in the database. The following figure illustrates how the Axd<Document> and Ax<Table> classes interact in a document exchange.
The Microsoft Dynamics AX classes in the XML Document Framework.
For more information about these classes, see Document Services Classes.
The XML Document Framework classes are the basis of the out-of-the-box document services that come with Microsoft Dynamics AX. You can use these document services as is or customize them for your business requirements. For more information about the standard documents, see Standard Axd Documents.
The XML Document Framework also enables you to create new document services based on your own business logic. For more information, see Creating New Services.