Response Rest service with List

0
Hi All, I need a suggestion for retrieving list data by using rest service without passing any parameter. All list type examples are working after entering any search parameter and I want help in without entering any parameter. For example:- Using below mentioned link I want to retrieve country names. https://restcountries.eu/rest/v2/all  
asked
4 answers
2

If you have an object containing the data, create a published rest service.

Add a resource and for this reource add an operation.

In the operation select the microflow returning the data. THis will default to a string return value so change this to the list of objects coantinaing the data. Make sure to retrieve the data in the microflow and map the result of the retrieve to the endpoint.

Double click the operation an you'll see that the response has been changed to a list of your objects and a mapping is required. Press the select button to create a new mapping.

In the mapping select the option message defintion and create the message definition for your object. In the mapping make sure to mapp all relevant fields.

Now you have a GET operation for your published REST service without any parameters.

answered
0

Thanks Erwin for your revert. Actually, I am talking about consuming web service and might be you gave an example of publish web service. Can you help me with in consuming rest service without any parameter. 

answered
0

You are in modeler 7.17 so you can create your published rest-service with drag-and-drop. Here is how:

- in your modeler in the 'Project Explorer'-view right-click on your module name and choose 'Add other' and 'Published REST Service'. It will add a REST-service

- in your modeler in the 'connector'-view drag any entity to your REST-service.

- Run

[Edited]

ah, you are consuming the service. Preventing having to enter a parameter is done by not adding a parameter in the location.

See for further details the perfect click-by-click manual: https://github.com/mendix/docs/blob/development/content/howto/integration/consume-a-rest-service.md

See https://mymendixdemo100-sandbox.mxapps.io/ → Menu-item “RestDemo Countries” for the result of retrieving the data from countries.eu

answered
0

I am talking about consuming web service and might be you gave an example of publish web service. CCleaner Happy Wheels VLC

answered