In my usecase i have to chain two service calls. In particular:
1) The first call returns an xml listing several IDs
2) i have to iterate through the returned ID list and to make an ID parameterized service call for each id-item.
3) Finally i have to collect a whole response made up of each single ID-service-response.
Suppose the first service call returns a response like this one:
<result>
<Link>
<Id>93451</Id>
</Link>
<Link>
<Id>93450</Id>
</Link>
...
The second step is to perform a series of calling to parameterized endpoint like this:
http://myEndpoint/entry/eutils/efetch.fcgi?db=pubmed&rettype=abstract&retmode=xml&id=<ID>
each call of which returns an xml response like this:
<response>
<field1>value1</field1>
<field2>value2</field2>
<field3>value3</field3>
<response>
I have to collect a whole response like this one:
<finalResponse>
<response>
<field1>value1</field1>
<field2>value2</field2>
<field3>value3</field3>
<response>
<response>
<field1>value1</field1>
<field2>value2</field2>
<field3>value3</field3>
<response>
<response>
<field1>value1</field1>
<field2>value2</field2>
<field3>value3</field3>
<response>
</finalResponse>
How can i do? Could you give me some example? Thanks