What is best practice when calling a webservice using the
autogenerated webservice classes in Flex ?
Right now I create a new webservice instance and hook up
events for each call to a webservice method. I am considering if it
would be better to have a single instance of the webservice object,
and use this for all webservice calls ? - then I only need to hook
up result and fault events once. So are there any problems in using
a single webservice instnace for all webserivce calls ?
No problems that I have ever seen. I always use a single
instance of the WebService or HTTPService.
In case you haven't discovered it yet, the send() methods
return an AsyncToken, which is a dynamic object that is associated
with the particular send call. You can put almost anything in that
object, including callback functions. I typically just use a string
callId, and sometimes a nextProcess string. In the result handler,
you can access those properties, and know how to handle the result.
There are examples in the docs, and I have posted some here