++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'ax-demo' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[main] org.mule.module.launcher.DeploymentDirectoryWatcher:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Mule is up and kicking (every 5000ms) +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[main] org.mule.module.launcher.StartupSummaryDeploymentListener:
**********************************************************************
* - - + DOMAIN + - - * - - + STATUS + - - *
**********************************************************************
* default * DEPLOYED *
**********************************************************************
*************************************************************************************
* - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS *
*************************************************************************************
* ax-demo * default * DEPLOYED *
*************************************************************************************
Microsoft Dynamics AX 2012 Connector
The Anypoint Connector for Microsoft Dynamics AX 2012 enables Mule applications to interact with the Microsoft Dynamics AX Query Service. Microsoft Dynamics AX is an enterprise resource planning (ERP) application.
Release Notes: Microsoft Dynamics AX 2012 Connector Release Notes
The Microsoft Dynamics AX 2012 Connector supports these operations:
Operation | Description |
---|---|
Query table |
Run a query against an Application Object Tree (AOT) Table. For more information, see the Microsoft AOT table site. |
Static query |
Run an AOT static query. |
Before You Begin
Install the Windows Gateway Services
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 follows:
-
The connector sends an HTTP request to the Windows Gateway Services.
-
The Windows Gateway Services receives the HTTP request.
-
The Windows Gateway Services executes the request against the Dynamics AX System Services using the ` net.tcp ` protocol.
-
The Windows Gateway Services receives the response from the Dynamics AX System Services.
-
The Windows Gateway Services sends the response to the connector over HTTP.
-
The connector receives the response.
All communication between the Anypoint Platform and Windows Gateway Services is authenticated and secured by SSL.
Installation
To install the Microsoft Dynamics AX 2012 Connector in Anypoint Studio:
-
Under the Help menu in Anypoint Studio, click Install New Software.
-
From Work with drop down, click
Anypoint Connectors Update Site
. -
Expand the Select category and click the checkbox for Microsoft Dynamics AX 2012 Connector . Click Next .
-
Review the details of the item you selected, and click Next.
-
Select I accept the terms of the license agreement and click Finish.
-
Click Restart Now to complete the installation.
-
After Studio restarts, expand the Connectors palette group to see your recently added Microsoft Dynamics AX 2012 Connector.
Create a New Mule Project
Open Anypoint Studio and create a new project:
-
From the menu, select File > New > Mule Project.
-
In the New Mule Project window, enter ax-demo as the Project Name.
-
Click Finish.
Create and Configure a New Microsoft Dynamics AX Global Element
Configure the connector’s connection:
-
Click the Global Elements tab.
-
Click Create to bring up Global Type dialog box.
-
In the Search text box, enter ax.
-
Select Microsoft Dynamics AX: Gateway Connection and click OK.
-
Fill in the required 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 on which the Application Object Server is running.
Gateway Router Service Address
The address (host and port) of the Windows Gateway Services. This address is usually similar to
https://myserver.com:9333/router
. -
Click Test Connection to make sure the connection works correctly.
-
Once the connection is successful, click OK.
Create a Flow to Query Dynamics AX
Create a Mule flow to query the "ProjTable". To create the Mule flow, follow these steps:
-
Click the Message Flow tab.
-
Search for http and drag an HTTP connector onto the canvas. This creates a new flow.
-
Search for ax and drag the Microsoft Dynamics AX 2012 connector next to the HTTP connector, in the Process area.
-
Search for json and drag an Object to JSON transformer next to Microsoft Dynamics AX 2012.
-
Double-click the HTTP connector. Click the plus sign (+) beside the Connector Configuration list.
-
In the HTTP Listener Configuration window, make sure Protocol is set to HTTP, Host is set to All Interfaces [0.0.0.0] (Default) and Port is set to 8081. Click OK.
-
Under Basic Settings, set the Path to /query.
-
Double-click Microsoft Dynamics AX 2012 and update the following configuration values:
-
From the Connector Configuration list, select the Microsoft Dynamics AX 2012 Connector configuration that was previously created.
-
From the Operation list, select Query table.
-
From the Language list, click DataSense Query Language.
-
Click Query Builder…
-
From the list of Types, select ProjTable.
-
From the list of Fields, select ProjId and ProjGroupId.
-
From Order By list, select ProjId.
-
From Direction list, select DESCENDING.
-
-
Click OK.
Running the Flow
-
In Package Explorer, right click demo-ax and select Run As > Mule Application.
-
Check the console to see when the application starts. You should see the following message if no errors occurred:
-
Open an Internet browser and visit
http://localhost:8081/query
-
The list of accounts ordered by descending name should be returned in JSON format (results vary according to your AX instance).
[{"ProjId":"DAT-000009","ProjGroupId":"Group-2"},{"ProjId":"DAT-000008","ProjGroupId":"Group-1"},{"ProjId":"DAT-000007","ProjGroupId":"Group-0"}]
Example of Using the Connector
To start the demo:
-
Import the project folder in Studio.
-
Update the Microsoft Dynamics AX connection parameters in /src/main/app/mule-app.properties.
-
Click Test Connection to make sure the connection works correctly.
-
Run the application.
The demo includes the following operations:
-
Query all projects from ProjTable table:
http://localhost:8081/projects
-
List all projects (static query ProjListProjectTable):
http://localhost:8081/list-projects
-
Get project by ProjId (static query ProjListProjectTable):
http://localhost:8081/list-projects?ProjId={projid}
Operations
-
Query Table
Run a query on an AOT table.
-
Static Query
Run an AOT static query.
Input
The following table details the operation’s input parameters.
Parameter | Description |
---|---|
staticQueryName |
The name of the static query to execute. |
fetchSize |
The size of the page for paging the results. |
[Message Payload] |
For the static queries that accept input parameters, a |