• No results found

Application Integration Framework

In document AX2012_ENUS_DEV_4 (Page 64-67)

AIF provides an extensible framework within Microsoft Dynamics AX that enables the exchange of data. AIF consists of three primary components.

• Services: With AIF you can expose any business logic 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. Document services are typically used to exchange data with other systems.

NOTE: For more information about standard document services and how to

create your own document services, refer to the Services and AIF development (http://go.microsoft.com/fwlink/?LinkId=238168) page on MSDN.

Document services exchange data in the form of XML documents. Document services provide the tools to build business-to-business (B2B) and application-to- application (A2A) integration between your system and trading partners or other external software systems. AIF includes many services that encapsulate common business functionality that you can use out of the box. Additionally, there is a wizard that you can use to create your own custom document services. AIF document services have the following types of exchanges.

• Adapter-based exchange: An asynchronous document exchange that uses an adapter in Microsoft Dynamics AX. In this type of exchange, documents are moved through the system in queues and processed by the batch jobs. Adapter transports supported by AIF are Microsoft Message Queuing (also known as MSMQ) and file

systems. If you use the Message Queuing adapter, you must have Message Queuing or installed on the AIF gateway computer. • Web services-based exchange: A synchronous document exchange

that uses web services. Because this type of exchange is synchronous, queues are not used. The web services can be

generated automatically from the Microsoft Dynamics AX business logic. Developers with limited web experience can easily expose services through web services. AIF supports WCF services.

Microsoft Dynamics AX supports integration with the Application Integration Framework (AIF) components by using the Microsoft Dynamics AX services programming model. You can customize the document services that are included with Microsoft Dynamics AX, create new custom services, and consume external web services. To support a range of option for customization and

programmability, Microsoft Dynamics AX provides the following types of services.

• Custom Services are services that you create to expose X++ logic through a service interface. You can use the business logic with inbound or outbound transfers. The types of services are developed by using the Business Operation Framework (BOF). This is done by creating X++ classes that expose their logic through the use of attributes available within the BOF.

• Document Services represent data and business logic within Microsoft Dynamics AX. You can use or customize the over 70 standard Axd document services that are included with Microsoft Dynamics AX. If standard document services do not meet your needs, you can create a new document service by using the AIF Document Service Wizard. Each document is represented by a class. The name of a document class is preceded by Axd. For example, AxdSalesOrder is the name of the document and also the name of the document class. The terms "document" and "Axd document" and "document class" are used interchangeably.

• System Services cannot be customized. The Query Service, Metadata Service, and User Session Service are Windows Communication Foundation (WCF)-based services included with Microsoft Dynamics AX. They provide access to data returned in queries, metadata for AOT objects such as tables and extended data types (EDTs), and data about the calling user such as default language and default company.

With Microsoft Dynamics AX, you can consume external web services from X++ code, and consume web services hosted by Microsoft Dynamics AX from .NET Framework languages such as Microsoft Visual C#.

Microsoft Dynamics AX supports application integration and data exchange in both intranet and Internet-facing scenarios. Services that are based on WCF classes are hosted on the AOS for applications to integrate within the intranet of a company. To consume or expose services over the Internet, you must install and use IIS. For more information about Microsoft Dynamics AX web services on IIS refer to the Install web services on IIS

Business Operation Framework

The Business Operation Framework (BOF) is the model-view-controller framework that synchronously or asynchronously controls the execution of immediate or batched business operation implementations. It lets you run services on Microsoft Dynamics AX by using the Windows Communication Foundation (WCF) framework.

BOF uses services to call from the client to the server so application “chattiness” is reduced. The BOF classes separate the user interface, business logic, and data contract logic. You can use BOF to write applications that have reduced client to server communication. Because BOF uses services, there is no calling from the client back to the server, and an open connection from the server to the client cannot be maintained. The user interface for input parameters can be auto- generated.

Features of the BOF include the following.

• Allows menu-driven execution or batch execution of services. • Calls services in synchronous or asynchronous mode.

• Automatically creates a customizable UI based on the data contract. • Encapsulates code to operate on the appropriate tier (prompting on

the client tier, and business logic on the server tier).

To create a Business Operation Framework service, you must follow these steps. • Create a data contract class.

• Identify the parameters that are passed to the service.

• Register the class as a Business Operation Framework service. • Optionally customize the automatically generated UI for the class.

NOTE: For more information about services, AIF, and the BOF, refer to the

Application Integration Framework and Services in Microsoft Dynamics® AX course.

NOTE: Additional examples of how to use the BOF can be found in the

Interop to X++

A proxy class is a .NET Framework class that provides access to one X++ item type of Microsoft Dynamics AX. You can build proxies for the following X++ item types:

• Classes: Both application and system classes. • Tables: Both application and system tables. • Enums: Both base and system enums.

CAUTION: You cannot build a proxy for an X++ interface. If you try, a proxy is

generated for a .NET Framework class which at best approximates the interface. This incorrect translation into a class causes some common scenarios to fail, and it might create problems in future releases.

You can generate the proxy C# or Visual Basic source code by using the Application Explorer in Microsoft Visual Studio. Proxies are usually a better alternative to .NET Business Connector. .NET Business Connector requires your C# code to use a late-bound programming model. Proxies provide an early-bound programming model. With the early-bound model the Code Editor can provide IntelliSense, and it can also catch misspellings and other errors at compile time, that is, before the code is run.

There are different scenarios for constructing a proxy object from a proxy class that is written in C# or in another .NET Framework language. The following topics describe three possible scenarios.

In document AX2012_ENUS_DEV_4 (Page 64-67)

Related documents