Packagemx.rpc.http
Classpublic class Operation
InheritanceOperation Inheritance AbstractOperation Inheritance AbstractOperation Inheritance AbstractInvoker Inheritance flash.events.EventDispatcher

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

An Operation used specifically by an HTTPMultiService. An Operation is an individual operation on a service usually corresponding to a single operation on the server side. An Operation can be called either by invoking the function of the same name on the service or by accessing the Operation as a property on the service and calling the send(param1, param2) method. HTTP services also support a sendBody method which allows you to directly specify the body of the HTTP response. If you use the send(param1, param2) method, the body is typically formed by combining the argumentNames property of the operation with the parameters sent. An Object is created which uses the argumentNames[i] as the key and the corresponding parameter as the value.

The exact way in which the HTTP operation arguments is put into the HTTP body is determined by the serializationFilter used.



Public Properties
 PropertyDefined By
 InheritedargumentNames : Array
An ordered list of the names of the arguments to pass to a method invocation.
AbstractOperation
 Inheritedarguments : Object
The arguments to pass to the Operation when it is invoked.
AbstractOperation
  concurrency : String
[override] Value that indicates how to handle multiple calls to the same service operation.
Operation
  contentType : String
[override] Type of content for service requests.
Operation
 Inheritedheaders : Object
Custom HTTP headers to be sent to the third party endpoint.
AbstractOperation
 InheritedkeepLastResult : Boolean
Flag indicating whether the operation should keep its last call result for later access.
AbstractInvoker
 InheritedlastResult : Object
[read-only] The result of the last invocation.
AbstractInvoker
  makeObjectsBindable : Boolean
[override] When this value is true, anonymous objects returned are forced to bindable objects.
Operation
  method : String
[override] HTTP method for sending the request.
Operation
 Inheritedname : String
The name of this Operation.
AbstractOperation
 InheritedoperationManager : Function
This property is set usually by framework code which wants to modify the behavior of a service invocation without modifying the way in which the service is called externally.
AbstractInvoker
 Inheritedproperties : Object
This is a hook primarily for framework developers to register additional user specified properties for your operation.
AbstractOperation
 Inheritedrequest : Object
Object of name-value pairs used as parameters to the URL.
AbstractOperation
 InheritedrequestTimeout : int
Provides access to the request timeout in seconds for sent messages.
AbstractOperation
 InheritedresultElementType : Class
Like resultType, used to define the ActionScript class used by a given operation though this property only applies to operations which return a multi-valued result (e.g.
AbstractInvoker
  resultFormat : String
[override] Value that indicates how you want to deserialize the result returned by the HTTP call.
Operation
 InheritedresultType : Class
Specifies an optional return type for the operation.
AbstractInvoker
  rootURL : String
[override] The rootURL is used to compute the URL for an HTTP service operation when the a relative URL is specified for the operation.
Operation
 InheritedserializationFilter : SerializationFilter
A SerializationFilter can control how the arguments are formatted to form the content of the HTTP request.
AbstractOperation
 Inheritedservice : AbstractService
[read-only] Provides convenient access to the service on which the Operation is being invoked.
AbstractOperation
  showBusyCursor : Boolean
[override] If true, a busy cursor is displayed while a service is executing.
Operation
 Inheritedurl : String
Location of the service.
AbstractOperation
  useProxy : Boolean
[override] Specifies whether to use the Flex proxy service.
Operation
 InheritedxmlDecode : Function
ActionScript function used to decode a service result from XML.
AbstractOperation
 InheritedxmlEncode : Function
ActionScript function used to encode a service request as XML.
AbstractOperation
Public Methods
 MethodDefined By
  
Operation(service:HTTPMultiService = null, name:String = null)
Creates a new Operation.
Operation
 Inherited
cancel(id:String = null):AsyncToken
Cancels the last service invocation or an invokation with the specified ID.
AbstractInvoker
 Inherited
clearResult(fireBindingEvent:Boolean = true):void
Sets the result property of the invoker to null.
AbstractInvoker
  
send(... args):AsyncToken
[override] Executes the http operation.
Operation
 Inherited
sendBody(parameters:Object):AsyncToken
AbstractOperation
 Inherited
setResult(result:Object):void
This hook is exposed to update the lastResult property.
AbstractInvoker
Protected Methods
 MethodDefined By
 Inherited
getHeaders():Object
Returns the HTTP request headers.
AbstractOperation
 Inherited
Returns the serialization filter.
AbstractOperation
Events
 Event Summary Defined By
 InheritedDispatched when an Operation call fails.AbstractOperation
 InheritedDispatched when an Operation invocation successfully returns.AbstractOperation
Property Detail
concurrencyproperty
concurrency:String[override]

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Value that indicates how to handle multiple calls to the same service operation. The default value is multiple. The following values are permitted:


Implementation
    public function get concurrency():String
    public function set concurrency(value:String):void
contentTypeproperty 
contentType:String[override]

Type of content for service requests. The default is application/x-www-form-urlencoded which sends requests like a normal HTTP POST with name-value pairs. application/xml send requests as XML.


Implementation
    public function get contentType():String
    public function set contentType(value:String):void
makeObjectsBindableproperty 
makeObjectsBindable:Boolean[override]

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

When this value is true, anonymous objects returned are forced to bindable objects.


Implementation
    public function get makeObjectsBindable():Boolean
    public function set makeObjectsBindable(value:Boolean):void
methodproperty 
method:String[override]

HTTP method for sending the request. Permitted values are GET, POST, HEAD, OPTIONS, PUT, TRACE and DELETE. Lowercase letters are converted to uppercase letters. The default value is GET.


Implementation
    public function get method():String
    public function set method(value:String):void
resultFormatproperty 
resultFormat:String[override]

Value that indicates how you want to deserialize the result returned by the HTTP call. The value for this is based on the following:

The default value is object. The following values are permitted:


Implementation
    public function get resultFormat():String
    public function set resultFormat(value:String):void
rootURLproperty 
rootURL:String[override]

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

The rootURL is used to compute the URL for an HTTP service operation when the a relative URL is specified for the operation. The directory name of the rootURL is prepended to any relative URLs for the operation. It is typically more convenient to set the baseURL since baseURL specifies the directory name directly whereas rootURL specifies the name of a file whose directory name is prepended. If neither rootURL nor baseURL are set explicitly, the directory name of the .swf file is prepended to relative paths.


Implementation
    public function get rootURL():String
    public function set rootURL(value:String):void
showBusyCursorproperty 
showBusyCursor:Boolean[override]

If true, a busy cursor is displayed while a service is executing. The default value is false.


Implementation
    public function get showBusyCursor():Boolean
    public function set showBusyCursor(value:Boolean):void
useProxyproperty 
useProxy:Boolean[override]

Specifies whether to use the Flex proxy service. The default value is false. If you do not specify true to proxy requests though the Flex server, you must ensure that the player can reach the target URL. You also cannot use destinations defined in the services-config.xml file if the useProxy property is set to false.


Implementation
    public function get useProxy():Boolean
    public function set useProxy(value:Boolean):void
Constructor Detail
Operation()Constructor
public function Operation(service:HTTPMultiService = null, name:String = null)

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Creates a new Operation.

Parameters
service:HTTPMultiService (default = null) — The HTTPMultiService object defining the service.
 
name:String (default = null) — The name of the service.
Method Detail
send()method
override public function send(... args):AsyncToken

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Executes the http operation. Any arguments passed in are passed along as part of the operation call. If there are no arguments passed, the arguments property of class is used as the source of parameters. HTTP operations commonly take named parameters, not positional parameters. To supply the names for these parameters, you can also set the argumentNames property to an array of the property names.

Parameters

... args — Optional arguments passed in as part of the method call. If there are no arguments passed, the arguments object is used as the source of parameters.

Returns
AsyncToken — AsyncToken Call using the asynchronous completion token pattern. The same object is available in the result and fault events from the token property.