Nav

Microsoft Dynamics AX Connector

The Microsoft Dynamics AX connector allows Mule applications to interact with Microsoft Dynamics AX Query Service.

The connector supports the following operations:

The connector supports the following Microsoft Dynamics AX versions:

  • Microsoft Dynamics AX 2012

Prerequisites

This document assumes that you are familiar with Mule, Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and Global Elements.

You need login credentials to test your connection to your target resource.

For hardware and software requirements and compatibility information, see the Connector Release Notes.

To use this connector with Maven, view the pom.xml dependency information in the Dependency Snippets in Anypoint Exchange.

Install the Windows Gateway Services for Anypoint Platform.

Windows Gateway Services for Anypoint Platform

The Windows Gateway Services agent performs protocol translation when calling the Dynamics AX System Services. The Dynamics AX System Services (Metadata Service, Query Service) use the net.tcp protocol which is not implemented in Java. To execute requests, the connector routes the requests through the Windows Gateway Services as described below.

microsoft dynamics ax protocol translation

  1. The connector sends an HTTP request to the Windows Gateway Services.

  2. The Windows Gateway Services receives the HTTP request.

  3. The Windows Gateway Services executes the request against the Dynamics AX System Services using the netTcp protocol.

  4. The Windows Gateway Services receives the response from the Dynamics AX System Services.

  5. The Windows Gateway Services sends the response to the connector over HTTP.

  6. The connector receives the response.

All communication between the Anypoint Platform and Windows Gateway Services is authenticated and secured by SSL.

What’s New in this Connector

First Mule 4 release.

To Connect in Design Center

  1. In Design Center, click Set Up > Upload, browse for and select the driver for this connector on your file system, and upload it. Alternatively, search for and select a driver that is already uploaded.

  2. Click a trigger. You can create a global element by selecting this connector as they trigger. If a global element is not needed, you can use an HTTP Listener or Scheduler trigger.

microsoft dynamics ax design listener

Click on the plus sign and search for Dynamics Ax Connector and select Query Table Operation.

Click Edit to configure the connector.

Configure these fields:

  1. For general settings complete these fields:

    • Company: Sets the company to use within all calls.

    • Language: Sets the language to use within all calls.

    • Logon as user: Sets the user to use within all calls.

    • Message id:Sets the message id to use within all calls.

    • Partition key: Sets the partition key to use within all calls.

Connection parameters:

Parameter Description

Username

The username to connect to Dynamics AX.

Password

The password to connect to Dynamics AX.

AOS Server Name

The name or IP of the server where the Application Object Server is running on.

AOS Services WSDL Port

The port number that the Services WSDL run on. Default is 8101.

Gateway Router Service Url

The address (host and port) of the Windows Gateway Services. This address is usually similar to https://myserver.com:9333/router.

For advanced connection complete these fields:

  • AOS Endpoint Port (Optional): Use this configuration to override the service endpoint that is in the services' WSDL document.

  • Connection timeout:Used to set connection timeout for connector requests. This optional value is in milliseconds (0 for unlimited timeout).

  • Receive timeout:Use to set reception timeout for connector requests. This optional value is in milliseconds

Complete the Query to with: dsql:SELECT Name,Type FROM ProjTable Complete Fetch Size with: 20

microsoft dynamics ax design operation

Connect in Anypoint Studio 7

You can use this connector in Anypoint Studio by first downloading it from Exchange and configuring it as needed.

Install Connector in Studio

  1. In Anypoint Studio, click the Exchange icon in the Studio taskbar.

  2. Click Login in Anypoint Exchange.

  3. Search for this connector and click Install.

  4. Follow the prompts to install this connector.

When Studio has an update, a message displays in the lower right corner, which you can click to install the update.

Configure in Studio

  1. Drag and drop the connector to the Studio Canvas.

microsoft dynamics ax component

  1. For general settings complete these fields:

microsoft dynamics ax any config

  • Company: Sets the company to use within all calls.

  • Language: Sets the language to use within all calls.

  • Logon as user: Sets the user to use within all calls.

  • Message id:Sets the message id to use within all calls.

  • Partition key: Sets the partition key to use within all calls.

Connection parameters:

Parameter

Description

Username

The username to connect to Dynamics AX.

Password

The password to connect to Dynamics AX.

AOS Server Name

The name or IP of the server where the Application Object Server is running on.

AOS Services WSDL Port

The port number that the Services WSDL run on. Default is 8101.

Gateway Router Service Url

The address (host and port) of the Windows Gateway Services. This address is usually similar to https://myserver.com:9333/router.

For advanced connection complete these fields:

microsoft dynamics ax any advanced config

  • AOS Endpoint Port (Optional) - Use this configuration to override the service endpoint that is in the services' WSDL document.

  • Connection timeout - Used to set connection timeout for connector requests. This optional value is in milliseconds (0 for unlimited timeout).

  • Receive timeout - Use to set reception timeout for connector requests. This optional value is in milliseconds.

Use Case: Studio

  1. Add a listener to the flow.

  2. Click the green plus sign to configure.

  3. Set Host to localhost and Port to 8080.

  4. Click OK.

  5. Add Query Table operation from Microsoft Dynamics AX pallette.

  6. Configure connection by clicking on the green plus sign.

  7. Set the above mentioned fields.

  8. Complete the Query parameter with :dsql: Select Name from ProjTable.

  9. Add a Transform Message and set it with following:

    
                
             
    1
    2
    3
    4
    
    %dw 2.0
    output application/json
    ---
    payload
  10. Perform the curl localhost:8080 command.

Use Case XML


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:microsoft-dynamics-ax="http://www.mulesoft.org/schema/mule/microsoft-dynamics-ax"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/microsoft-dynamics-ax
http://www.mulesoft.org/schema/mule/microsoft-dynamics-ax/current/mule-microsoft-dynamics-ax.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
    <configuration-properties file="mule-app.properties"/>

    <http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config">
        <http:listener-connection host="localhost" port="8082"/>
    </http:listener-config>

    <microsoft-dynamics-ax:dynamics-ax-config name="Microsoft_Dynamics_AX_Dynamics_AX"
      doc:name="Microsoft Dynamics AX Dynamics AX">
        <microsoft-dynamics-ax:soap-connection disableCnCheck="true"
          gatewayRouterServiceAddress="${gateway-connection-config.gatewayRouterServiceAddress}"
           username="${gateway-connection-config.username}"
           password="${gateway-connection-config.password}"
           aosServerName="${gateway-connection-config.aosServerName}"
           aosWsdlPort="${gateway-connection-config.aosWsdlPort}"/>
    </microsoft-dynamics-ax:dynamics-ax-config>

    <flow name="dynamics-old-ax-demoFlow2">
        <http:listener doc:name="Listener"
            config-ref="HTTP_Listener_config" path="/query"/>
        <set-payload value="#[attributes.queryParams.queryToExecute]" doc:name="Set Payload"/>
        <microsoft-dynamics-ax:query-table itemsPerPage="5" doc:name="Query table"
          config-ref="Microsoft_Dynamics_AX_Dynamics_AX">
            <microsoft-dynamics-ax:query>#[payload]</microsoft-dynamics-ax:query>
        </microsoft-dynamics-ax:query-table>
        <ee:transform doc:name="Transform Message" doc:id="cfd8849c-23be-43ee-943d-b2f9f17815c9">
            <ee:message>
                <ee:set-payload><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
            </ee:message>
        </ee:transform>
    </flow>

</mule>

microsoft dynamics ax use case