| Package | net.guttershark.support.servicemanager.remoting |
| Class | public dynamic class RemotingService |
| Inheritance | RemotingService flash.utils.Proxy |
When you make a service call from the service manager, and pass it an object of properties, you are passing it a "callProps" object.
Supported properties on the callProps object:
callprops.params sent through the
request as the second parameter to your onResult, or onFault callback
import net.guttershark.managers.ServiceManager;
import net.guttershark.support.serviceamanager.shared.CallResult;
import net.guttershark.support.serviceamanager.shared.CallFault;
var sm:ServiceManager = ServiceManager.gi();
//this sets up a remoting service.
sm.createRemotingService("users","http://localhost/amfphp/gateway.php",3,1,3000,true);
//make a remoting call.
sm.users.getUserByName({param:["sam"],onResult:onr,onFault:onf,onCreate:onc,onRetry:onrt,onTimeout:ont,attempts:2,timeout:3000,returnArgs:true});
function onr(cr:CallResult,params:Array):void{} //onResult
function onf(cf:CallFault,params:Array):void{} //onFault
function onc():void{} //onCreate
function onrt():void{} //onRetry
function ont:void(){} //onTimeout
A remoting service supports something called a "limiter" which means that if a request is being made to a service with X parameters, another request to that service CANNOT be made until a result,timeout,or fault occurs on the first call.
| Method | Defined by | ||
|---|---|---|---|
|
RemotingService(rc:RemotingConnection, endpoint:String, attempts:int, timeout:int, limiter:Boolean)
Constructor for RemotingService instances.
| RemotingService | ||
|
call(methodName:String, ... args):*
This is not the recommended way of using the remoting service, but is available
so you can call service methods where the methd name comes from a string variable.
| RemotingService | ||
|
dispose():void
Dispose of this RemotingService.
| RemotingService | ||
|
toString():String
Friendly description.
| RemotingService | ||
| RemotingService | () | constructor |
public function RemotingService(rc:RemotingConnection, endpoint:String, attempts:int, timeout:int, limiter:Boolean)Constructor for RemotingService instances.
Parametersrc:RemotingConnection — A RemotingConnection that this service will use.
|
|
endpoint:String — The service endpoint.
|
|
attempts:int — How many attempts can be made before a timeout occures.
|
|
timeout:int — The time to allow each request, before retrying.
|
|
limiter:Boolean |
| call | () | method |
public function call(methodName:String, ... args):*This is not the recommended way of using the remoting service, but is available so you can call service methods where the methd name comes from a string variable.
ParametersmethodName:String |
|
... args |
* |
var sm:ServiceManager = ServiceManager.gi();
var tf:TextField = new TextField();
tf.text = "helloWorld";
sm.helloWorldService.call(tf.text,{...});
//the normal way:
sm.helloWorldService.helloWorld({...});
| dispose | () | method |
public function dispose():voidDispose of this RemotingService.
| toString | () | method |
public function toString():StringFriendly description.
ReturnsString |