REST service call to display a result set

0
Hi Team, I have a microflow which calls a REST service. The aim to display a result set as a end of a search criteria. When I give username and click on search it has give the set of transactions done by the user. How can I show the result set in a new page from the response of a REST service.  But the response is something like this.  <REPEATED_ATTRIBUTE_DETAIL KEY="Object::Application::ResultList"> <ATTRIBUTE_DETAILS> <ATTRIBUTE_DETAIL KEY="Object::transaction::CustID">506950</ATTRIBUTE_DETAIL> <ATTRIBUTE_DETAIL KEY="Object::transaction::transactionStatus">CANCELED</ATTRIBUTE_DETAIL> </ATTRIBUTE_DETAILS> <ATTRIBUTE_DETAILS> <ATTRIBUTE_DETAIL KEY="Object::transaction::CustID">506951</ATTRIBUTE_DETAIL> <ATTRIBUTE_DETAIL KEY="Object::transaction::transactionStatus">SUCCESS</ATTRIBUTE_DETAIL> </ATTRIBUTE_DETAILS> </REPEATED_ATTRIBUTE_DETAIL> Can someone help me on this?  
asked
2 answers
0

Create non persistent objects and map the JSON response to those entities. You can then make a nice screen where you show those newly created non persistent objects.

Regards,

Ronald

 

answered
0

Sushmitha,

The way to do this in Mendix is to

  1. create an XML Schema 
  2. create an Import Mapping
  3. in the Call REST action in your microflow, in the response tab, select Apply Import Mapping and then point to the mapping you just created

Once you do this, you will have the returned information from the REST call in a set of non persistent entities in your Mendix app so you can manipulate them with native Mendix tools.

A how to can be found here:  https://docs.mendix.com/howto/integration/consume-a-rest-service

This how to uses a JSON structure instead of an XML Schema, however the rest of the process works the same.

One thing you'll need to create an XML Schema is an XSD file for the response from the REST service.  If you don't have access to this, you can use services like this to create an XSD file from the XML returned by the REST call: https://www.freeformatter.com/xsd-generator.html

Hope that helps,

Mike

answered