AX Consulting

Just another site

WCF and AIF in Dynamics AX 2009

Imparted from here

AIF is a standards-based framework that allows you to publish and consume web services.  It’s used primarily in integration scenarios when connecting Dynamics AX with other systems.  AX also has .NET Business Connector (BC.NET) for integrating with .NET applications.  BC.NET is more for client side integration.  AIF is all about web services and is completely standards-based. Under the covers AIF takes full advantage of .NET using Windows Communication Foundation (WCF).  For more complex integration scenarios AIF can also help expose services using MSMQ and BizTalk.

With Dynamics AX 2009, the team ships a bunch of services (about 60 out of the box) that are ready for use.  That includes, for example, the more common scenarios like integration with sales orders or customers.  AIF allows you to create, read, update and delete those sales orders while maintaining the integrity of the database (i.e. without directly touching the database at all).  This is done independent of the transport so when developing you could begin by updating via http and later switch to MSMQ.  This can be as simple as enabling the service then “generating” which generates the WCF interface (i.e. WSDL).  That web service is then available to be consumed by any standards-based client (including apps written in php, java and naturally any of the languages in Visual Studio).  You can also configure the service endpoints to change the binding or authentication parameters.

In the video, Michael walks us through using a standard Excel Visual Studio Tools for Office (VSTO) project to consume a AX 2009 sales order service that is exposed using AIF.  He also shows us how, by using WS-Addressing in the WCF headers, you can pass a target company for a web service call. By default, AX limits error messages coming back from the server for security reasons.  Michael shows us how to configure AX to propagate those errors when you need to see them.

Dynamics AX is a rich platform for supply chain management and financials.  AIF opens up AX so that ISVs can build on that richness by integrating their own applications.  Sometimes when you do that you need to consume a web service exposed by external applications.  We see here how you can plug external web services into the AX processes.  In this case, Michael shows us how when trying to create a customer in Dynamics AX with a name that has been blacklisted by the US government (“Bin Laden”, for instance.  Yikes!  Smiley ) the customer create process calls out to an external web service in the cloud to verify the customer name.  This seamless integration of external processes is a boon for ISVs that need those deep integration points.  Michael explains how. In order to do this sort of integration you build a Service Reference in the Application Object Tree (AOT) to provide the parameters.  AX takes care of much of work by generating the artifacts (compilation, deploying, bundling etc) that are deployed and executed on the server.  CLR interop is available in order to use .NET DLLs and their classes.

Some code samples are available here:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: