Creating a Document Inbound AIF Service in Microsoft Dynamics AX 2012

Overview

Application Integration Framework (AIF) services are used to communicate with external systems or applications. Microsoft Dynamics AX 2012 has the following types of services:

  1. Document services
  2. Custom services
  3. System services

An AIF service can be Inbound or Outbound. An Inbound service is used to send data to an external system while Outbound services are used to retrieve data.

This tutorial will guide you in creating Document Inbound AIF services for Microsoft Dynamics AX 2012.

Document services are XML documents that initiate transfer of data into or out of Dynamics AX. Any entity in AX can be represented as Documents, such as Customers or Sales Orders.

Document services are used when we have to execute complex CRUD (Create, Read, Update, Delete) operations on an entity.

Pre-requisites

  1. Microsoft Dynamics AX 2012
  2. AIF services must be installed and configured on IIS

Scenario

As part of this tutorial, the service will return the list of Item IDs in Dynamics AX

Steps

  1. Document service uses an AOT query to generate related artifacts. For this tutorial, InventTable query will be used
  2.  

  3. Open Microsoft Dynamics AX Development workspace. Go to Tools à Application Integration Framework àCreate document service
  4.  

  5. This will open the AIF Document Service Wizard. Click Next to proceed
  6.  

  7. In this step, specify the Document parameters. Select the Query for which service has to be created. The Document name will default to Query name. Modify it as required and give a suitable Document label as shown below. Click Next
  8.  

  9. Now specify the Code generation parameters. The wizard will use this to create the respective classes. Check the required Service operations you want to be automatically created by the wizard. Click Next

    Note: To allow Update/Delete/Create Service operations, the Update property must be set to Yes

  10.  

  11. In the Generate code window, review the artifacts that will be generated. Click Generate to proceed
  12.  

  13. The wizard will now generate all the artifacts. In the end, a Completed screen will display the list of artifacts it created. Click Finish to exit the wizard
  14.  

  15. The next step is to create a service group and deploy the service to an Inbound Port
  16.  

  17. Go to Service Groups, right click on it, and select New Service Group
  18.  

  19. Name it InventServiceDemoGroup
  20.  

  21. Set AutoDeploy to Yes (so the service will start automatically when AOS is started) and set the Description to Item Id service
  22.  

  23. Right click the newly created service group and select New Service Node Reference
  24.  

  25. In the newly created service node, set the Service property to InventTableDemoService. The Name property will automatically default to the Service name
  26.  

  27. Now right click the service group and select Deploy Service Group
  28.  

  29. A success message will appear if the service group is successfully deployed
  30.  

  31. To verify, go to System administration à Setup à Services and Application Integration Framework à Inbound ports
  32.  

  33. The Service group name InventServiceDemoGroup will appear here as Port name with a green tick mark. This shows that the service group is deployed and active. If a red cross mark is present, select Activate from the action pane to activate the port
  34.  

  35. The WSDL URI is the URL of the service which can be used by external systems to access the service
June 3, 2014