Mendix
Version 22.0.8486
Version 22.0.8486
Mendix
This page outlines the steps to connect Mendix to your CData Connect OData Endpoint.
Prerequisites
Before you connect, you must first do the following:
-
Connect a data source to your CData Connect account. See Data Model for more information.
-
Configure your OData tables and columns from your data sources.
-
Generate an Authtoken on the Users page. Copy this down, as it acts as your password during authentication.
Note: To connect Mendix to CData Connect, your CData Connect instance must be hosted in an internet-facing server that is accessible to other entities through a stable URL (for example, myConnectInstance.cdata.com). If your instance of CData Connect is hosted locally and only accessible from a localhost address (for example, localhost:8080) or local network IP address (for example, 192.168.1.x), it will not be able to communicate with Mendix.
Connecting to CData Connect
To establish a connection from Mendix to your CData Connect OData API, follow these steps.
Step 1: Downloading the OData Metadata File
When creating a connection in Mendix, the connection flow requires a Data Source Contract File. Follow these steps to download the OData metadata file for CData Connect using curl, a command line tool:
-
Open a command-line window for your operating system.
-
On Windows, open the start menu, type cmd, and press the enter key to open a command prompt.
-
On macOS and Linux, open a Terminal window.
-
-
To check if curl is installed on your system, type curl -help and press the enter key. If it is not installed, install it from the curl website.
-
Issue the following curl command:
curl -u [user]:[Authtoken] [baseURL]/odata.rsc/$metadata -o metadata.xml
-
Replace
[user]
with your CData Connect username. -
Replace
[Authtoken]
with the Authtoken you generated above. -
Replace
[baseURL]
with the address of your CData Connect server (for example, myConnectInstance.cdata.com).
-
-
Locate the metadata.xml file that the curl command created and move it to an accessible location.
Step 2: Connecting to CData Connect in Mendix
Follow these steps to establish a connection from Mendix to CData Connect:
-
Login to Mendix and open the Data Hub page.
-
In the Register a Data Source section, select OData.
-
Upload the metadata.xml file from the steps above and click Next.
-
Enter your desired values for Data Source Name and Data Source Version.
-
In the Data Source Relative Path field, enter /odata.rsc/ and click Next.
-
On the Application information page, click Register a new application.
-
Enter a name in Application Name and select a technical owner (by default, this is the user who is currently logged in).
-
Click Next. In the Environment Name field, enter a desired name (for example, CData Connect).
-
In the Environment Location field, enter the base URL of your Mendix server. This is also displayed in the connection modal in Mendix.
-
Select Non-Production for the environment type.
-
Click Done! to create your connection.
You can now use your connection in Mendix Studio Pro.