This content has been marked as final. Show 3 replies
1) use a single WebService instance
2) use a single result handler function
3) Use AsyncToken to associate a result with a specific call
The handler function can act as a "switchboard". When it gets a result labeled "myCall1", it can call a function, say doCall2(). Or it can do anything else you want.
Do a bit of research, and post back if you need more help.
Thanks for the pointers, but I'm not totally clear.
Are you suggesting that I "chain" the calls together so that when one completes it calls the next? As an aside, do you find that to be more efficient - or faster - than calling two web services at once?
I don't think I can use the same web service instance because the calls have different wsdls. Is that right/wrong?
You can set the wsdl property at will.
If the order of the calls is not important, then do something similar to what you have suggested. Have the calling function increment an instance variable counter. Have the result handler and fault handler function decrement the counter. When it is zero, you wll know all of your calls have returned. Really, just like a flag, but more flexible.