RESTservice in 7.11.0 allways returns Unknown Response type

0
Eagerly trying the newly added Modeler feature for publishing REST I have set up an App with two Entities (Person and Secret) and want to publish their data. See my demo-App My restservice is available via the button "Sharing secrets" or just go to this link directly My Problem is that each REST-service returns the message "Response body 'Unknown response type'" Both at GET and POST services. Got a feeling that I am missing an option to set the ResponseType. Should be somewhere in the action 'Create HttpResponse' where I can add the attributes 'Statuscode' 'Reasonphrase' 'HttpVersion' and Content. Which I have set to 200, 'successful operation', 'HTTP/1.1' and the content is a valid JSON-string.  The MF for the first service (GET/Geheim/GetAll) is this one: https://modelshare.mendix.com/models/d43bc13e-ea12-4008-a254-8c2a467423fe/secret-get-all  Any ideas how to set the ResponseType?
asked
2 answers
5

You will have to set a HTTP response header to indicate what the content type of your response is. You can do this as follows:

1. Add a new Create object activity after creating the HttpResponse object.

​

2. Set the Entity to System.HttpHeader

​

3. Set Key to 'Content-Type'.

​

4. Set Value to 'application/json'.

​

5. Set the association System.HttpHeaders to $NewHttpResponse, the HttpResponse you've just created in your microflow.

​

 

You can now successfully call your REST service and the response will be shown.

​

 

If your response contains a different content type than a JSON string, you should adjust the Value of your HTTP Content-Type header accordingly. See https://www.w3.org/Protocols/rfc1341/4_Content-Type.html for more information.

answered
0

And it gets even better and more straightforward now that I have found the Add->Mappings->Message Definitions in the modeler!

answered