benzarod
Posts: 0
Joined: Mon May 21, 2012 9:02 pm

REST service results that use 2 more REST services.

Hi Guys,
Basically I have a REST service that return a JSON array.
For each entry I need to call another REST service and show the result in the same grid.

So, If I don't link the results array to the Grid, works perfect but shows only 1 result.

If I link the results array to the grid, shows all the results but I don't know how to do to call the other services.

I hope you guys understand me.

Thanks
Rodrigo

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST service results that use 2 more REST services.

To invoke any service from JavaScript, you can do this:

code
serviceInstanceName.execute({});
/code
http://help.tiggzi.com/documentation/...

But you need to get data, so above won't exactly work. Another approach is to create a Generic Service (https://getsatisfaction.com/tiggzi/to...) or even just create the service yourself and invoke (you will see an example here: http://help.tiggzi.com/documentation/... ). You will get data back from the service and will need to add it to the current element (insert into DOM) manually.

A few things to keep in mind. Services will be invoked asynchronously and there is a limit to how many Ajax requests a browser will do.

Hope this helps...

benzarod
Posts: 0
Joined: Mon May 21, 2012 9:02 pm

REST service results that use 2 more REST services.

Thanks Max,

For some reason the last link is an 404.

benzarod
Posts: 0
Joined: Mon May 21, 2012 9:02 pm

REST service results that use 2 more REST services.

Ok, I got it, remove the extra ).

benzarod
Posts: 0
Joined: Mon May 21, 2012 9:02 pm

REST service results that use 2 more REST services.

It is not clear for me when I need to invoke the service I have created.
Basically, I need to call it for each specific value the SERV1 returned.

Example:

SERV1 -- MLA123
MLA124
MLA125

I need to call SERV2 for MLA123 show the result in the same grid and do the same with the other 2 entries.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST service results that use 2 more REST services.

You could call the other service in mapping.

benzarod
Posts: 0
Joined: Mon May 21, 2012 9:02 pm

REST service results that use 2 more REST services.

Thanks Max
I'm calling the other service in response mapping in under the grid object.
via JS, serviceInstanceName.execute({});

From what I can see, the service executed well, but don't map the output to the elements.
Any suggestion?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

REST service results that use 2 more REST services.

You can only map one service to a page. Once you get data back from the second service, you need to add the data/markup with JavaScript.

Return to “Issues”