Mendix


Mendix


This page outlines the steps to connect Mendix to CData Connect using the OData protocol. This requires the use of virtual datasets. See the Virtual Datasets documentation for more information.

Prerequisites

Before you connect, you must first do the following:

  • Connect a data source to your CData Connect account. See Connections for more information.
  • Create a virtual dataset Workspace. Later, you will use the OData Service URL on that page (https://cloud.cdata.com/api/odata/{workspace_name}) with the relevant workspace name to establish the connection.
  • Generate a Personal Access Token (PAT) on the Settings page. Copy this down, as it acts as your password during authentication.

Connecting to CData Connect

To establish a connection from Mendix to CData Connect using the OData protocol, follow these steps.

Then, download the OData metadata file according to the steps below.

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:

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

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

  3. Issue the following curl command, replacing [user] with your CData Connect username and [PAT] with the PAT you generated above:

    curl -u [user]:[PAT] https://cloud.cdata.com/api/odata/service/$metadata -o metadata.xml

  4. Locate the metadata.xml file that the curl command created and move it to an accessible location.

Connecting to CData Connect in Mendix

Follow these steps to establish a connection from Mendix to CData Connect:

  1. Login to Mendix and open the Data Hub page.

  2. In the Register a Data Source section, select OData.

  3. Upload the metadata.xml file from the steps above and click Next.

  4. Enter your desired values for Data Source Name and Data Source Version.

  5. In the Data Source Relative Path field, enter /api/odata/service and click Next.

  6. On the Application information page, click Register a new application.

  7. Enter a name in Application Name and select a technical owner (by default, this is the user who is currently logged in).

  8. Click Next. In the Environment Name field, enter a desired name (for example, CData Connect).

  9. In the Environment Location field, enter https://cloud.cdata.com and select Non-Production for the environment type.

  10. Click Done! to create your connection.

You can now use your connection in Mendix Studio Pro.