Groups | Blog | Home
all groups > macromedia flash flash remoting > july 2005 >

macromedia flash flash remoting : Multiple Service Calls


TK01
7/15/2005 12:00:00 AM
hi,

i'm using Remoting 2.0 components and making service calls from within an AS
class file.

if I create a Service object, shouldn't I then be able to reuse its connection
for multiple calls, using PendingCall to call service methods anywhere in my
class file?

to invoke each service method on my app server I'm having to create several
Service objects, passing the gateway URI, service name, etc... this doesn't
seem proper.

shouldn't you be able to invoke multiple service methods on one Service object
connection, using however many number of PendingCall objects, in separate
methods throughout my Class file?

MM documentation doesn't address this very well.

Didn't have any problems with this using Remoting 1.0.

Thanks.

Chris
7/17/2005 8:14:43 PM
[quoted text, click to view]

Yes and no.

Yes, you can use the Service object as many times as you want

No, the PendingCall object exists specifically for each call made.
Whenever you make a call on a Service object, the Service object
returns a PendingCall object. If you make a 100 calls, you'll get 100
distinct PendingCall objects. Even if you call the same method 100
times, the results aren't always the same. You need to handle each
result separately, especially if you get errors.

[quoted text, click to view]

It sounds like you don't fully understand what a PendingCall object is
and how it's used.
Yas_007
7/25/2005 12:00:00 AM
Yeah you're right that is not right. It works fine with me, basically there is
one init function which handles the service object creation, this is done once
which means you have connected to the gateway, from then on you just call the
service by name, you do not pass the gateway URL everytime.
targetplanet
8/2/2005 12:00:00 AM
What if I want to have multiple cfc file for my site? the gateway can only
connect to one cfc at a time, but there seems to be noway to get to a differant
cfc without opening a new connection. is it poor practice to have multiple
connections at one, i.e.
var conn1:Service = new Service(gwURL, null, serv1, null, null);
var conn2:Service = new Service(gwURL, null, serv2, null, null);

cdrabik
8/2/2005 8:05:39 PM
AddThis Social Bookmark Button