---
schema_version: "1"
id: 10f57f6088f4f6926af9517b18c566124e47f807b1ec3a336731d4a8fe5b911b
title: Microsoft Dynamics AX 2012 Connector
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/microsoft-dynamics-ax-connector/latest/index.md
canonical_url: https://docs.mulesoft.com/microsoft-dynamics-ax-connector/latest/
source_site: docs.mulesoft.com
content_type: documentation
content_hash: bc2e275260e7cb4227b6269d4ae22a20ef8db53dda0b01a10c268bbbe1958440
description: MuleSoft Documentation Site
release: "2.0"
latest: true
---
---
product: Microsoft Dynamics AX 2012 Connector
version: 2.0
is-latest-version: true
---

# Microsoft Dynamics AX 2012 Connector

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Microsoft Dynamics AX 2012 Connector v2.0

Anypoint Connector for Microsoft Dynamics AX 2012 (Dynamics AX 2012 Connector) enables Mule apps to
interact with the 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.

## Before You Begin

To use this connector, you must be familiar with:

- Microsoft Dynamics AX

- Mule, Mule concepts, elements in a Mule flow, and Global Elements

- Anypoint Connectors

- Anypoint Studio

Before creating an app, you must have:

- Microsoft login credentials to test your connection to your target resource

- Anypoint Windows Gateway Services installed

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

## POM File Information

```xml
<dependency>
  <groupId>com.mulesoft.connectors</groupId>
  <artifactId>mule-microsoft-dynamics-ax-connector</artifactId>
  <version>x.x.x</version>
  <classifier>mule-plugin</classifier>
</dependency>
```

Replace `x.x.x` with the version that corresponds to the connector you are using.

To obtain the most up-to-date `pom.xml` file information, access the connector in
[Anypoint Exchange](https://www.mulesoft.com/exchange/) and click **Dependency Snippets**.

### 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 shown in the following image:

![Microsoft Dynamics AX Connector global elements properties config window on General tab](/mulesoft/current/en-us/microsoft-dynamics-ax-connector/latest/_images/ms-dynamics-ax-protocol-translation.png)

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.

## Connect in Anypoint Studio 7

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

## Add the Connector to a Studio Project

Anypoint Studio provides two ways to add the connector to your Studio project: from the Exchange
button in the Studio taskbar or from the Mule Palette view.

### Add the Connector Using Exchange

1.  In Studio, create a Mule project.

2.  Click the Exchange icon **(X)** in the upper-left of the Studio task bar.

3.  In Exchange, click **Login** and supply your Anypoint Platform username and password.

4.  In Exchange, search for "ax".

5.  Select the connector and click **Add to project**.

6.  Follow the prompts to install the connector.

### Add the Connector in Studio

1.  In Studio, create a Mule project.

2.  In the Mule Palette view, click **(X) Search in Exchange**.

3.  In **Add Modules to Project**, type "ax" in the search field.

4.  Click this connector’s name in **Available modules**.

5.  Click **Add**.

6.  Click **Finish**.

### Configure in Studio

1.  Drag a connector operation to the Studio Canvas.

    ![Query Table operation](/mulesoft/current/en-us/microsoft-dynamics-ax-connector/latest/_images/ms-dynamics-ax-component.png)

2.  For general settings complete these fields:

    ![Global Elements Properties General configuration tab](/mulesoft/current/en-us/microsoft-dynamics-ax-connector/latest/_images/ms-dynamics-ax-any-config.png)

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

      <table><colgroup><col> <col></colgroup><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td><p>Username</p></td><td><p>The username to connect to Dynamics AX.</p></td></tr><tr><td><p>Password</p></td><td><p>The password to connect to Dynamics AX.</p></td></tr><tr><td><p>AOS Server Name</p></td><td><p>The name or IP of the server where the Application Object Server is running.</p></td></tr><tr><td><p>AOS Services WSDL Port</p></td><td><p>The port number that the Services WSDL run on. Default is <code>8101</code>.</p></td></tr><tr><td><p>Gateway Router Service Url</p></td><td><p>The address (host and port) of the Windows Gateway Services. This address is usually similar to <code>https://myserver.com:9333/router</code></p></td></tr></tbody></table>

For advanced connection complete these fields:

![Microsoft Dynamics AX Connector global elements properties config window on Advanced tab](/mulesoft/current/en-us/microsoft-dynamics-ax-connector/latest/_images/ms-dynamics-ax-any-advanced-config.png)

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

    ```dataweave
    %dw 2.0
    output application/json
    payload
    ```

10. Perform a curl to `localhost:8080`

## Use Case XML

```xml
<?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>
```

## See Also

- [Windows Gateway Services Configuration Guide](https://docs.mulesoft.com/connectors/windows-gateway-services/windows-gateway-services-guide-mule4)

- Run a query against an
  [AOT table](https://learn.microsoft.com/en-us/dynamicsax-2012/developer/tables-overview?redirectedfrom=MSDN)

- Run an
  [AOT static query](https://learn.microsoft.com/en-us/dynamicsax-2012/developer/queries-in-the-aot-for-data-access?redirectedfrom=MSDN)

- Call an
  [AIF Document Service](https://learn.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/aif-document-services?redirectedfrom=MSDN)

- [Salesforce Help](https://help.salesforce.com)
