webservice return only one record

webservice return only one record

  
Hi , I´m make a simple webservice, to return a list of records.

In flow I´m put query , the query return more than one when tested, and Assign to output parameters.

But the xml resulted only have one record.

It´s necessary to create loop logic with assign for xml tags and concat data ? Don´t exist automatic flow for this ?

thanks in advance.
Hi Sergio,

can you add your espace to someone can take a look because it is possible to return a list of records.

Cheers, 
RNA
Hi thanks , you can see 2 webservices that i´m using for test  Categoria Webservice, and GetCategoriaList method, this return only  last record. And Movimento Webservice return only  first record.

In both I´m wan´t return all records.

Attached my e-space test.

thanks in advance
Hi Sérgio,

Well, it only returns the last record because that is what you are setting the return values to.

If you want to return a list, you have to create an output parameter which is a Record List.

There are 2 ways to do it now.

1) The Record type of the Record List should be set to the same as the query.

- In the output parameter properties, in Record type, select the Record Editor > Select the 3 entities: Categoria, TipoEntrada, TipoSaida
- With an assign node, set the Output parameter to be your query's return list.

2)

As an alternative,

- Create a Structure that has as many attributes you want to return
- Make the output record type be that structure
- Create a local variable whose data type is the return structure
- Iterate through the query, and use ListAppend to append the local structure variable to the return list, one per each Query Record returned

I hope these make sense.

Regards,

Paulo Tavares