Publish REST issue

1
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!
asked
1 answers
3

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 http://www.mendix.com/blog/rest-part-ii-publishing-microflows-rest/ 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 https://github.com/mendix/RestServices/blob/mx5-master/README.md 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.
answered