Book Image

Microsoft Dynamics AX 2012 R2 Services

Book Image

Microsoft Dynamics AX 2012 R2 Services

Overview of this book

Table of Contents (17 chapters)
Microsoft Dynamics AX 2012 R2 Services
About the Authors
About the Reviewers

New and enhanced features

Services have been around for some time in Microsoft Dynamics AX. AIF was initially introduced with the release of Microsoft Dynamics AX 4.0, with Microsoft Dynamics AX 2009 continuing to build on that. But with the release of Microsoft Dynamics AX 2012, Microsoft has really succeeded in bringing the service functionality to a whole new level. Occasionally, even more features and enhancements are added in new releases and cumulative updates. Let us take a walk through the major changes that Microsoft Dynamics AX 2012 brings to the table.

The AOS WCF service host

The first major feature that has been added to this release is that the AOS is now the host for the Microsoft Dynamics AX 2012 services. In previous releases, the exchange of messages was either through adapters such as the filesystem, BizTalk, and MSMQ adapter, or services that were exposed as WCF 3.5 services through IIS. With the latter, IIS was acting as the host for the WCF services.

With this new release of Microsoft Dynamics AX, services will be exposed as WCF 4.0 services hosted directly in the AOS Windows service. As long as intranet users and applications are consuming these services, no IIS is needed.

WCF adapters

Microsoft Dynamics AX 2012 provides a lot more support for WCF. Proprietary adapters such as BizTalk and MSMQ that were previously available are now obsolete and no longer available. Instead, support for MSMQ and BizTalk is provided by a native WCF equivalent of these adapters.

This does not mean that creating custom adapters using the AIF adapter framework is not supported anymore. Custom adapters can still be added by implementing the AifIntegrationAdapter interface.

Out of the box, Microsoft Dynamics AX 2012 comes with the following adapters:

  • NetTcp: This is the default adapter used when creating a new integration port. This adapter type corresponds to the WCF NetTcpBinding. It provides synchronous message exchanges by using WS-* standards over the Transmission Control Protocol (TCP).

  • Filesystem: This can be used for asynchronous exchange of XML messages stored in the filesystem directories.

  • MSMQ: This is used when support for queuing is needed. Message exchange is asynchronous and uses MSMQ. Note that choosing this adapter type actually uses the WCF NetMsmq binding.

  • HTTP: This supports synchronous message exchanges over the HTTP and HTTPS protocols. This was already available in Microsoft Dynamics AX 2009, but there is a difference in the deployment to the IIS. The business connector is no longer used for services hosted on the IIS; instead, a WCF routing service is used. There is more about routing services later in this chapter.


    More information about the bindings that are used in these adapters can be found on MSDN at If you want to learn more about WS-* standards, check out the Web Services Specification Index Page at

Integration ports

In Microsoft Dynamics AX 2009, there was a lot of configuration required to get AIF up and running. This included configuration of the following:

  • Endpoints

  • Local endpoints

  • Channels

  • Endpoint users

  • Endpoint constraints

Now, integration ports have been added and they provide a simpler way to configure services. There are two types of integration ports: inbound and outbound. Which type you should use for your service depends on whether the message originates from outside or inside of Microsoft Dynamics AX.

The inbound integration ports can be divided into two types: basic and enhanced. Out of the box, Microsoft Dynamics AX 2012 already has some services that are associated with basic integration ports. These have been deployed and enabled by default. We will discuss how these basic ports differ from enhanced ports in later chapters.

Instead of having Microsoft-Dynamics-AX-specific endpoints and channels, integration ports use native WCF to deploy services and therefore endpoints, security, behaviors, bindings, and so on. All of this is configured using the WCF Configuration utility. By default, integration ports are hosted on the AOS using the NetTcp binding.

IIS hosting without Business Connector

Previously, when services were deployed on IIS, they used the .NET Business Connector to communicate with the AOS. This has been replaced by a WCF routing service that implements the IRequestReplyRouter interface. Regardless of whether services are consumed from the intranet or the Internet, they are always processed by the AOS. So, when services are deployed to be used on the Internet, they will be deployed both on the AOS and on the IIS. The AOS hosts the service using the NetTcp binding, and the IIS has a WCF routing service that will forward service requests to the internal services hosted on the AOS.

Non-XML support

Using transformations, Microsoft Dynamics 2012 can transform inbound messages from a variety of formats into a format AIF can understand. Likewise, outbound messages can be transformed from the AIF format into a format required by external systems. There are two types of transformations that can be used: Extensible Stylesheet Language Transformations (XSLT) and .NET assemblies.

You can create XSLT transformations by using any text editor, but tools such as BizTalk MAPPER, Visual Studio, or Altova MapForce make it very easy. .NET assemblies are DLL files that can be compiled using Visual Studio and do transformations in code. This is especially convenient for transforming from or into a non-XML format. Some of the tools available can actually generate both the XSLT and the managed code needed to compile a .NET assembly.