Packagenet.guttershark.support.servicemanager.remoting
Classpublic dynamic class RemotingService
InheritanceRemotingService Inheritance flash.utils.Proxy

The RemotingService class creates and sends remoting requests. This class is used internally, and when using the service manager to make remoting calls, you are invariably using this class without realizing it. Don't use this class directly, use the service manager, this class is strictly for documentation.

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:


Example
An extended remoting call example, with all callProp object properties filled in:
 
  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.



Public Methods
 MethodDefined 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
Constructor detail
RemotingService()constructor
public function RemotingService(rc:RemotingConnection, endpoint:String, attempts:int, timeout:int, limiter:Boolean)

Constructor for RemotingService instances.

Parameters
rc: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
Method detail
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.

Parameters
methodName:String
 
... args

Returns
*

Example
Calling a service with the call method:
 
   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():void

Dispose of this RemotingService.

toString()method 
public function toString():String

Friendly description.

Returns
String