Best practice REST implementation

0
Hi, I've implemented the Rijksmuseum REST example but noticed there are quite different ways of implementing REST so I have some questions about the best practice. The examples in the documentation are mostly using the JAVA actions. However, for outgoing calls there is a 'CALL Rest activity' available. Should I use that or stick to Java for as long REST is in developement by Mendix? There is an option in Export Mapping to use a JSON structure. But only the top most element in the structure can be (de)selected. When will it possible to use the REST export mapping to define what attributes are exposed in a publised webservice? It is possible to use the Service Definition screen to expose a business domain to CRUD operations. But I fail to find out how I can define parameters for the service. Is it true that only the 'key' is supported as parameter? If not, does anybody know where I can find documentation on how to configure the Service Definition on that point (and yes, I've read the GitHub 'Mendix REST Services module' documentation) Services that are configured using the Service Definition screen seems to return all available objects if no key is supplied. Is it possible to prevent that behavior (no key provided means, no objects returned)
asked
1 answers
0

Hi Rolf, 1. As of version 6.6.0 (released June 27th 2016), you can now consume REST-webservices natively in a Mendix-microflow, the tutorial you refer to is written in 2015. It is a stable release, so yes, you can use this new activity. 2. Along with this new activity, a JSON-import/export mapping functionality is released in version 6.6.0. I do not encounter the same problem: inside a Exportmapping item, I can select which attributes should be exported. If you need different attributes for another POST-webservice, I suggest you use also another Exportmapping. 3. For published REST-services you do need the REST Services Module indeed. And as far as I know, you only have one key-attribute to identify an already existing object, but you can create your own handler in a microflow. What do you need exactly? 4. Did you try to create your own microflow?

answered