Export (0) Print
Expand All

Application Integration Framework Overview

Application Integration Framework (AIF) is the infrastructure within Microsoft Dynamics AX with which you can expose business logic or exchange data with other systems. AIF is comprised of three primary components:

  • Services - Enable you to expose business logic written in X++ as a service to be consumed by other applications. Within Microsoft Dynamics AX, you can create, customize, and publish services.

  • Document services - A specific implementation of services in which the Microsoft Dynamics AX business logic is exposed through document services.

  • Consume Web services - In Microsoft Dynamics AX, you can consume external Web services from your X++ code.

In Microsoft Dynamics AX, you can build a custom service. This is done by creating a class in X++ that follows certain coding rules, defining a service interface by adding a new service to the AOT, and then linking the service interface to the service implementation class. You can then make the class methods available as service operations if the method parameters are serializable.

In Microsoft Dynamics AX, document services enable you to exchange data with external systems by sending and receiving data in XML documents. These documents represent business objects such as a customer, a vendor, a sales order, and so on. The AIF document services are designed to be extensible. Developers can create their own document services with the AIF Document Service Wizard or customize the services that ship with Microsoft Dynamics AX.

AIF enables enterprise application integration scenarios with a variety of transports, including the following:

  • File system

  • Microsoft Message Queuing (MSMQ)

  • Microsoft BizTalk Server 2006

  • Web services

Within the AIF architecture there are two primary areas of functionality—the transport components and the business logic components. Although transport functionality is separate from the business logic, the two are closely related.

AIF Architecture

The AIF architecture showing the transport layers above and the business logic layers below.

Transport

The transport components handle the transfer of business logic in and out of the system using XML documents. The elements of the transport layer define how data is exchanged, including the source of the data, the destination of the data, and how it is transported. These elements include the following:

  • Local endpoints

  • Transport adapters

  • Channels

  • Actions

  • Endpoints

  • Endpoint action policies

  • Endpoint action data policies

  • Queues

  • Global settings

  • Pipeline settings

  • Value mapping

The transport layer is implemented in Microsoft Dynamics AX through the forms that you use to configure AIF. To implement a document exchange, you must first configure the transport functionality that ships with Microsoft Dynamics AX for your specific environment and document exchange. For more information about configuring AIF transport elements, see "Configuring and managing AIF" in the Server and Database Administration Help.

Business Logic

The business logic component of document exchange consists of the data, its format, and the business rules that govern the data. This business logic is exposed by two sets of classes—the base classes and the document service classes in the XML Document Framework.

Base Classes

The AifDocumentService, AxdBase, and AxInternalBase base classes are the foundation of the Microsoft Dynamics AX business logic type hierarchy. They are described as follows:

  • AifDocumentService - The base class of all document service classes. All document services inherit from this class and provide a layer of abstraction over the AxdBase classes. The document service class operations (create, delete, find, findKeys, read, and update) call methods from this class (createList, deleteList, findList, findKeyList, readList, and updateList).

  • AxdBase – The base class of all Axd<Document> classes. All new documents inherit from this class. The AxdBase class enables you to serialize and deserialize XML to and from tables in Microsoft Dynamics AX. The AxdSalesOrder class is an example of a class that inherits from the AxdBase class.

    The AxdBase class exposes a number of methods that support the ability to create and read XML. The create methods create records in the Microsoft Dynamics AX database from XML. The read methods retrieve data from the database and return it as XML. The read and create methods implement their functionality by calling the AxdBaseRead and AxdBaseCreate classes, respectively.

  • AxInternalBase – This class provides a further level of abstraction for a table and contains functionality such as value substitution and dynamic defaulting. These classes also expose some of the underlying table's functionality such as field and record validation (they call the table validateField and validateWrite methods). The Microsoft Dynamics AX classes that are derived from AxInternalBase typically implement validation, value substitution, and data defaulting.

In AIF document services, the AifDocumentService instance classes expose service operations. When those service operations are called, the request is passed to the AxdBase class. The AxdBase instance classes read and write to database tables by using the AxInternalBase instance classes.

For example, to create a sales order, you call the SalesSalesOrderService.create method and pass in a data object that contains one or more sales orders. The SalesSalesOrderService class inherits from AifDocumentService. The create method then calls the AifDocumentService.createList method. The AifDocumentService.createList method deserializes the parameters, determines which Axd<Document> class to reference, and calls the createList method on the AxdSalesOrder class (which inherits from the AxdBase class). The call to AxdSalesOrder saves the sales order to the database using the Ax<Table> classes (which inherit from the AxInternalBase class) such as AxSalesTable, AxSalesLine, and so on.

XML Document Framework

The XML Document Framework is comprised of the classes that implement the business logic for individual documents in Microsoft Dynamics AX. These classes expose internal business logic to external systems and are used to create, read, update, and delete data.

The XML Document Framework contains the types of classes shown in the following table.

Class Type

Description

Example

Service class

The service class is the point of contact for external systems and exposes service operations to those systems: create, delete, find, findKeys, read and update. These classes provide a layer of abstraction from the Axd<Document> classes, and a service class exists for each Axd<Document> class. The service class inherits from the AifDocumentService class, which in turn accesses the AxdBase class. This is how a service class is linked to an Axd<Document> class.

SalesSalesOrderService

Document object

The class that represents the entire document and is the root data object.

SalesSalesOrder

Data objects

A data object class is created for each data source in the query. These objects are a tree that follows the hierarchy of the query data sources. For example, SalesSalesOrder_SalesLine is a child of SalesSalesOrder_SalesTable and so on. These objects are children of the root data object class.

SalesSalesOrder_SalesTable, SalesSalesOrder_SalesLine, SalesSalesOrder_DocuRefHeader, SalesSalesOrder_DocuRefLine, SalesSalesOrder_InventDim, SalesSalesOrder_MarkupTransHeader, SalesSalesOrder_MarkupTransLine

AOT service node

An entry in the AOT Services node where you can view and modify the properties of the service and its operations.

SalesSalesOrderService

Axd <Document> Class

Presents XML data as an electronic document. As a group, these classes provide a layer of abstraction from the complexity of the underlying tables and enable developers to implement business logic and error handling at the document level. Each Axd<Document> class has an associated query and can represent data from multiple tables. The Axd<Document>class can also be used to generate an XML schema that describes the document based on its associated query.

These classes eliminate the need for an external system that is exchanging data to be aware of the Microsoft Dynamics AX data model or business rules.

Note   The Axd<Document> class encapsulates the functionality of a document. The terms "Axd<Document> class" and "document" are therefore often used interchangeably.

AxdSalesOrder

Ax <Table> Class

Inherits from the AxInternalBase class and represents a single table in the AOT. As a group, these classes handle all interaction with the base tables and encapsulate any table-specific business logic. Therefore, the calling application does not require information about the Microsoft Dynamics AX table structures or database business rules. The Axd<Document>classes always use the Ax<Table> classes to read or write to the underlying tables. Typically, you will find an Ax<Table> class for each data source in the query.

AxSalesTable, AxSalesLine, AxInventDim, AxDocuRef, AxMarkupTrans

Microsoft Dynamics AX 2009 provides the ability to consume Web services from X++ code. Creating a service reference to an external Web service generates a .NET service proxy that enables the service to be available through IntelliSense within X++. The external Web service can be consumed by Microsoft Dynamics AX using the .NET service proxy through CLR interop.

Community Additions

ADD
Show:
© 2014 Microsoft