For this we will have two models with one to many relationship. Currency and Country. (since the same currency can be used in more than one country)

if you observe the Webservice output, you can see that it has a xml structure. now when you request will have more than one response values, it can grouped in two ways.

for example, the output can be in two different ways.

response 1:

<currency>

<country>

<code>GU</code>

<name>Guam</name>

</country>

<country>

<code>PW</code>

<name>Palau</name>

</country>

<country>

<code>EC</code>

<name>Ecuador</name>

</country>

<country>

<code>TL</code>

<name>Timor-Leste</name>

</country>

</currency>

response 2:

<currency>

<countries>

<country>

<code>GU</code>

<name>Guam</name>

</country>

<country>

<code>PW</code>

<name>Palau</name>

</country>

<country>

<code>EC</code>

<name>Ecuador</name>

</country>

<country>

<code>TL</code>

<name>Timor-Leste</name>

</country>

</countries>

</currency>

These 2 responses require two different configs.

Lets see for the first one response 1: .

As you can see in the config, you have to add a hierarchy. Give the node name from the response xml which it has to map for this hierarchy, which you have created now. Now map this to the model in which you want the data from this to be stored. and use add new parameter to map the fields in the model to the tags in the response xml.

Now in runtime if you call this action, based on the number of countries returned, that many number of country records will be created for the model country with a one to many relationship with that particular currency model's record.....

Now let's see what if the response was something like response 2:

Now from the above example we saw that for hierarchy we have a model which we map and get the values. But in response 2 we have one more hierarchy in the middle <countries> . Does that mean we need to have an empty model named countries with relations to country and currency?!!

Actually no. When defining the hierarchy of the output to receive in OrangeScape, you can add an empty hierarchy and leave it without mapping it to any of the models, and then create another inner hierarchy, to which you can map and receive the results. Once you do empty hierarchy, the relationship which shows over there will also show for the inner hierarchy which you have created. so you don't need to have another model in between.