Publish REST issue

We have requirement to publish a REST webservice on Mendix to return a list of records from an entity XEvent. We created a microflow returnXevent2 that read records from database XEvent, prepare data in transient entities returnXEvent and returning this object. We created a Service Definition 'demo' When we run this service, we are able to get returnXEvent object data but not its associated list of children (XEvent2). REST json response shows as blank list of XEvents Your help is greatly appreciated. Thanks!
1 answers

I think the issue is twofold:

  • You are using a persistent object as an input parameter to your microflow, which means the module won’t work. You must use a non-persistent object as input and output. If necessary, create extra non-persistent objects to do this, see for an example implementation.
  • You are setting up the REST service using the runtime configuration screens instead of the CreateMicroflowService microflow. If you look at you will see there are two types of services: microflows and data services. If you use the runtime forms, you will probably create a data service. If you want to publish a microflow as a service, you must use the CreateMicroflowService action. See the blog post above for how to do this.