locked
Multiple Simultaneous Async Calls RRS feed

  • Question

  • Hi

    Is it safe to make multiple asynchronous calls to update various portions of my Silverlight page? I have five-six (right now) grids that need to refresh with, preferably, click of one big "REFRESH" button.

    Here's a sample of calling two. It works. Is this safe to do? Will it scale? Can I increase this to, maybe, about 8 different calls? Each is a different web service that returns as different set of data.

    The application is a dashboard.

    Thanks a million

    Best

    -Y

    Dim getStatus As New WebServiceProxy.GetElectionDataSoapClient

    Dim stateStatusSOAPClient As New WebServiceProxy.GetElectionDataSoapClient

    Dim allianceOrParty As String = getAllianceOrParty()

    lStateName.Text = "Fetching Data. Please wait"

    stateStatusSOAPClient.getStateLeadsAsync("-1", "LS", getLeadsOrResults(), allianceOrParty)

    AddHandler stateStatusSOAPClient.getStateLeadsCompleted, AddressOf getAllIndiaLeadsCompleted

    getStatus.getSeatStatusAsync(getElectionType, "L")

    AddHandler getStatus.getSeatStatusCompleted, AddressOf getSeatStatusCompleted

    Monday, May 11, 2009 7:30 AM

Answers

  • there isn't any problem in running multiple calls to webservices. You may only have problem in your data has dependencies each other, because there is not any guarantee the calls returns data in the exact order they are called.

    HTH

    Monday, May 11, 2009 8:00 AM

All replies

  • there isn't any problem in running multiple calls to webservices. You may only have problem in your data has dependencies each other, because there is not any guarantee the calls returns data in the exact order they are called.

    HTH

    Monday, May 11, 2009 8:00 AM
  • Thanks a bunch.

    Of course, I have to ensure that any dependencies are taken care of - but I have none in this one./

     Once again, thanks for your response.

    Best

    -Y

     

    Monday, May 11, 2009 8:31 AM
  • yes, the limit is true, but remember that the browser pools the concurrent connection. It is like having a big number of images on an html page. Only a few images can be dowloaded simultaneously but the browser manage to keep the other waiting. While Silverlight use browser api to access the network this would apply also to webservices calls made by the plugin.

    bye

    Monday, May 11, 2009 3:58 PM
  • Great education!

     

    Thanks for your inputs

    Cheers!

    -Y

    Tuesday, May 12, 2009 1:31 AM
  •  

    Hi

    Continuing with the same theme, would it be OK to daisy chain these requests?

    I mean I will call one and from its completed event, call another and so on?

     Is that a good way of doing that?

    Or is it better to get one wrapper web service to get data from all other web services and send that over to the SL app?  The SL app can, then, break the return XML into pieces and use them

    What do you think?

     Thanks

    Iyer

     

    Tuesday, May 12, 2009 5:45 AM
  • > @Andrea thank you for the clarification, I've noticed that the number of concurrent connections can cause some timeouts on applications that consume several services, so I think this is a subject to consider and take in mind

    for sure... I want to investigate this problem because there is many cases where you have to start multiple calls and many people are asking about it.

    bye

    Tuesday, May 12, 2009 8:05 AM