Building a Jquery application which calls a number of endpoints to access data from two different web apps in my application. At one point the output on the page is dependant on data from both webservices. For example when a user submits a search webservice A retrieves codes for an item , then webservice B makes a call using the codes so it can get more details. These details are then displayed in a results table.
At the moment i have an ajax call and when it gets the codes it then calls webservice B using another ajax call to get details.
Should i be lookin to cut down on the number of roundtrips to the server by making the second webservice call from my server or is this acceptable behavior? I dont have the option to merge the code behind the webservices so i have to continue accessing the data via two distinct calls.
thanks
Here is my advice:
– Do it server side for the following reasons