Regarding the datahub metadata contract, what is the best approach when deploying outside the Mendix portal? URL or file? I have two deployed Datahub services, one is being consumed with a contract via URL, the other via file. The one that is being consumed by URL, I specified the URL to the dev environment when developing and deployed it. I imagine that is not the correct approach, or is it irrelevant from which environment the contract comes from? The file seems to be the best solution, however when I import it, I get the idea that the file is not directly imported into the app, rather you provide the location to where the file is. I hope I’m wrong, but just want to make sure. To sum it up: When consuming an OData service, and establishing the metadata contract: if I decide to go by URL, do I have to link to the respective environment where its being consumed (via constant)? If I decide to go with file, is the file imported into the app? Or am I providing just a location, which must be deployed also when the app goes to prod?
Vasco Lobo Branco
In my opinion I would say use the URL method. By creating constants in you application where the URL is needed. The default can be what you like. But then when you deploy your service you can update the URL in the constants list at domain model options.
Rick van Huffel
The update of the Metadata can be based on URL or File either way it will provide the Metadata file for studio so it knows all entities and attributes and definition of the OData service that you can use from the Data Hub pane. Using a URL would be easier if the definition changes since it will download the Metadata for you, by providing the Metadata file you will need to download the file first yourself.
After you have done this, you will still need to provide the Service URL through a constant so you can configure the OData services end-point for your specific environments.