# mulesoft Microsoft Dynamics AX 2012 Connector - Full Documentation --- 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 com.mulesoft.connectors mule-microsoft-dynamics-ax-connector x.x.x mule-plugin ``` 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:
ParameterDescription

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: ![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 #[payload] ``` ## 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) --- product: Microsoft Dynamics AX 2012 Connector version: 2.0 is-latest-version: true --- # Microsoft Dynamics AX 2012 Connector Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Microsoft Dynamics AX 2012 Connector v2.0 Release Notes: [Microsoft Dynamics AX 2012 Connector Release Notes](https://docs.mulesoft.com/release-notes/connector/ms-dynamics-ax-connector-release-notes-mule-4) ## Default Configuration ### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

Gateway Username Password

The connection types that can be provided to this configuration.

x

Expiration Policy

ExpirationPolicy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. The runtime actually purges the instances as it sees fit.

## Gateway Username Password Connection Type ### Parameters
NameTypeDescriptionDefault ValueRequired

Disable SSL Certificate validation

Boolean

When dealing with HTTPS certificates, if the certificate is not signed by a trusted partner, the server might respond with an Exception. To prevent this it is possible to disable the CN (Common Name) check. Note: this is not recommended for production environments.

false

Gateway Router Service Address

String

The address of the gateway service that routes the requests to the CRM instance (https://mygateway.com/router).

x

Aos Endpoint Port

String

For overriding the port returned in the Service’s WSDL.

Connection Timeout

Number

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

Receive Timeout

Number

Use to set receiving timeout for connector requests. This optional value is in milliseconds (0 for unlimited timeout).

Company

String

Sets the company to use within all calls (this setting can be overridden using the 'dynamicsax.callcontext.company' outbound property).

Language

String

Sets the language to use within all calls (this setting can be overridden using the 'dynamicsax.callcontext.language' outbound property).

Logon As User

String

Sets the user to use within all calls (this setting can be overridden using the 'dynamicsax.callcontext.logonAsUser' outbound property).

Message Id

String

Sets the message id to use within all calls (this setting can be overridden using the 'dynamicsax.callcontext.messageId' outbound property).

Partition Key

String

Sets the partition key to use within all calls (this setting can be overridden using the 'dynamicsax.callcontext.partitionKey' outbound property).

Username

String

x

Password

String

x

Aos Server Name

String

The Application Object Server (AOS) WSDL server name.

x

Aos Wsdl Port

String

The Application Object Server (AOS) WSDL port.

x

Reconnection

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

## Associated Operations - Invoke Document Service Operation - Query Table - Static Query ## Invoke Document Service Operation `` Executes a Document Service operation. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Action Input

Binary

#[payload]

Streaming Strategy

  • Repeatable In Memory Iterable Type

  • Repeatable File Store Stream Type

Configure to use repeatable and their behavior.

Service

String

The service group name (first level metadata key)

x

Action

String

The action name (second level metadata key)

x

Target Variable

String

The name of a variable on which the operation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and the outcome of that expression will be stored in the target variable

#[payload]

Reconnection Strategy

  • Reconnect

  • Reconnect Forever

A retry strategy in case of connectivity errors

### Output

Type

Binary

### For Configurations - dynamics-ax-config ### Throws - MICROSOFT-DYNAMICS-AX:CONNECTIVITY - MICROSOFT-DYNAMICS-AX:INVALID\_SESSION - MICROSOFT-DYNAMICS-AX:RETRY\_EXHAUSTED - MICROSOFT-DYNAMICS-AX:TRANSACTION - MICROSOFT-DYNAMICS-AX:TRANSFORMATION - MICROSOFT-DYNAMICS-AX:UNKNOWN - MICROSOFT-DYNAMICS-AX:VALIDATION ## Query Table `` Create a new record. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Query

String

x

Items Per Page

Number

x

Streaming Strategy

  • Repeatable In Memory Iterable

  • Repeatable File Store Iterable

Configure to use repeatable and their behavior.

Target Variable

String

The name of a variable on which the operation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and the outcome of that expression will be stored in the target variable

#[payload]

Reconnection Strategy

  • Reconnect

  • Reconnect Forever

A retry strategy in case of connectivity errors

### Output

Type

Array of Object

### For Configurations - dynamics-ax-config ### Throws - MICROSOFT-DYNAMICS-AX:CONNECTIVITY - MICROSOFT-DYNAMICS-AX:INVALID\_SESSION - MICROSOFT-DYNAMICS-AX:TRANSACTION - MICROSOFT-DYNAMICS-AX:TRANSFORMATION - MICROSOFT-DYNAMICS-AX:UNKNOWN - MICROSOFT-DYNAMICS-AX:VALIDATION ## Static Query `` ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Static Query Name

String

x

Ranges

Object

#[payload]

Items Per Page

Number

Streaming Strategy

  • Repeatable In Memory Stream

  • Repeatable File Store Iterable

Configure to use repeatable and their behavior.

Target Variable

String

The name of a variable on which the operation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and the outcome of that expression will be stored in the target variable

#[payload]

Reconnection Strategy

  • Reconnect

  • Reconnect Forever

A retry strategy in case of connectivity errors

### Output

Type

Array of Object

### For Configurations - dynamics-ax-config ### Throws - MICROSOFT-DYNAMICS-AX:CONNECTIVITY - MICROSOFT-DYNAMICS-AX:INVALID\_SESSION - MICROSOFT-DYNAMICS-AX:TRANSACTION - MICROSOFT-DYNAMICS-AX:TRANSFORMATION - MICROSOFT-DYNAMICS-AX:UNKNOWN - MICROSOFT-DYNAMICS-AX:VALIDATION ## Reconnection Type
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

Reconnection Strategy

  • Reconnect

  • Reconnect Forever

The reconnection strategy to use

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to reconnect (in milliseconds).

Count

Number

The number of reconnection attempts to make.

blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

true

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

true

## Expiration Policy Type
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit that qualifies the maxIdleTime attribute

## Repeatable In Memory Stream Type
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

This is the amount of memory that will be allocated to consume the stream and provide random access to it. If the stream contains more data than can be fit into this buffer, then it will be expanded by according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.

Buffer Size Increment

Number

This is by how much will be buffer size by expanded if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full.

Max Buffer Size

Number

This is the maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which all these attributes are expressed

## Repeatable File Store Stream Type
FieldTypeDescriptionDefault ValueRequired

Max In Memory Size

Number

Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it will start to buffer the content on disk.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which maxInMemorySize is expressed

## Repeatable In Memory Iterable Type
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

The number of instances to initially allow to keep in memory to consume the stream and provide random access to the stream. If the stream contains more data than can fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. Default value is 100 instances.

Buffer Size Increment

Number

By how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, and to raise a STREAM_MAXIMUM_SIZE_EXCEEDED error when the buffer gets full. Default value is 100 instances.

Max Buffer Size

Number

This is the maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower or equal to zero means no limit.

## Repeatable File Store Iterable Type
FieldTypeDescriptionDefault ValueRequired

Max In Memory Size

Number

This is the maximum amount of instances to keep in memory. If more than that is required, then it will start to buffer the content on disk.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which maxInMemorySize is expressed

## See Also [Salesforce Help](https://help.salesforce.com)