So you have a published rest service. That service has a problem with its export mapping. Since it is an export, not import, mapping, the mapping is in the Response-tab of your rest-service-activity. The rest service uses a microflow Location_Get_ByKey to fabricate the content of the response and the rest-service uses mapping EM_LocationExport to transform the result of your microflow to the required export format, JSON or XML. The result of your microflow is of entity type System.HttpResponse. The mapping EM_LocationExport however expects a different entity type. Hence this error.
So if you make sure that you make the microflow return its result in a format that the exportmapping can handle, this error will be resolved.
For better understanding / more details on what happens you have two options:
I was under the impression that the mapping was used to convert the domain model entity along with its associations into a formatted JSON string. Then that is put into an http response and exported to wherever it it consumed. That is how the Mendix documentation "Publish a REST Service" does it at least.
Hi community
You can add an export mapping, and in the microflow, directly return the object or list as mentioned in the documentation. It will work as expected, based on my experience.
Steps to implement:
ExportWithMapping
(Export to JSON) action or manually create an HttpResponse
or HttpHeader
. You can directly return the mapped object or the list retrieved from the database.