Monday 9 March 2015

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. Open Microsoft Dynamics AX Development workspace. Go to Tools à Application Integration FrameworkàCreate document service

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

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

  5. 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

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

  7. 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

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

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

  10. Name it InventServiceDemoGroup

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

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

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

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

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

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

  17. 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

  18. The WSDL URI is the URL of the service which can be used by external systems to access the service

No comments:

Post a Comment