WCF and AIF in Dynamics 2009: Chatting with Michael Merz

Play WCF and AIF in Dynamics 2009: Chatting with Michael Merz
Sign in to queue


In this video I’m back on the Advanta campus chatting with Michael Merz, Program Manager for Application Integration Framework (AIF) on the Dynamics AX team.

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:



Download this episode

The Discussion

  • User profile image
    Deforche Klaas

    Thanks for the video Ben and Michael.

  • User profile image


    i see your vedio it very useful to me. i done all the step whic you say in the vedio. I integreate AIF Service with .net successfully but whrn i integrate with AIF Service with PHP it is gvie error. you say that "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)."

    Error is come

    Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in /var/www/web/mdynamicax/Client/getcarriers.php:84 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://vm2008.t...', 'http://tempuri....', 1, 0) #1 [internal function]: SoapClient->__call('resultnumber', Array) #2 /var/www/web/mdynamicax/Client/getcarriers.php(84): SoapClient->resultnumber(Array) #3 {main} thrown in /var/www/web/mdynamicax/Client/getcarriers.php on line 84


    Please give me the guidence what i do in php for calling AIF web serivces , I used nusop_client and soapclient both but no success.

    if you contact me my id is dongavipul@hotmail.com. As soon as possible.

  • User profile image


    i slove this issue by sending credentials info using "setCredentials" in the php and it is done. Now problem is come for how to send parameter when calling any operation.

    for example calling read operation for the "customerservice.svc" we need "EntityKeyList" as parameter. but i am not find any thing about this how to send data from php to Dynamic AX. I see the error in the Basic->Periodic->AIF->Exceptions->"Value cannot be null. Parameter name: entityKeyList". 

    I have done sedning parameter from .net to Dynamica Ax it is ok not in the PHP.

    So please guide me how to send parameter from PHP to Dyanmaic Ax and get response?

  • User profile image


    i done sending parameter from php to dyanmic ax for read operation in customer service using entitykey and give the records based on entitykey but the problem is i want all custmer record ( which i think 100 customer )  so i pass null ( in the .net teram but blank in the phph ) in the QueryCriteria so after some time it is hang my server and shutdoen then what is the problem in that how i can get al the customer record without hang my pc.


    i have do this way in the php


    $params = array('QueryCriteria' => '');


    $baseURL = 'http://server_name:prot_number/MicrosoftDynamicsAXAif50/itemservice.svc?wsdl';

    $client = new NTLMSoapClient($baseURL);

    $result = $client->find($params); // it is hang my server.

Add Your 2 Cents