Nav

Microsoft Dynamics AX Connector

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

This connector supports the following operations:

  • Run a query against an AOT table.

  • Run an AOT static query.

  • Call an AIF Document Service.

The connector supports 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.

ms 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. Click a trigger such as HTTP Listener or Scheduler.

    ms dynamics ax design listener

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

  3. Click Edit to configure the connector.

  4. For general settings, complete these fields:

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

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

    • Log on 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

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

  6. Complete the Query with: dsql:SELECT Name,Type FROM ProjTable

  7. Complete Fetch Size with: 20

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

    ms dynamics ax component

  2. For general settings complete these fields:

    ms dynamics ax any config

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

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

    • Log on 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.

      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:

ms 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: Query Table

  1. Add an HTTP Listener to the flow.

  2. Click the green plus sign to configure it.

  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
    
    %dw 2.0
    output application/json
    payload
  10. Perform a curl to localhost:8080

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
<?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">
            <ee:message>
                <ee:set-payload><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
            </ee:message>
        </ee:transform>
    </flow>

</mule>

ms dynamics ax use case

See Also

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+