Pakiet | mx.rpc.http |
Klasa | public class AbstractOperation |
Dziedziczenie | AbstractOperation AbstractOperation AbstractInvoker EventDispatcher Object |
Podklasy | Operation |
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
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.
Właściwość | Zdefiniowane przez | ||
---|---|---|---|
argumentNames : Array
An ordered list of the names of the arguments to pass to a method invocation. | AbstractOperation | ||
arguments : Object
The arguments to pass to the Operation when it is invoked. | AbstractOperation | ||
concurrency : String
Value that indicates how to handle multiple calls to the same service. | AbstractOperation | ||
constructor : Object
Odwołanie do obiektu klasy lub funkcji konstruktora, dotyczące danej instancji obiektu. | Object | ||
contentType : String
Type of content for service requests. | AbstractOperation | ||
headers : Object
Custom HTTP headers to be sent to the third party endpoint. | AbstractOperation | ||
lastResult : Object [tylko do odczytu]
The result of the last invocation. | AbstractInvoker | ||
makeObjectsBindable : Boolean
When this value is true, anonymous objects returned are forced to bindable objects. | AbstractInvoker | ||
method : String
HTTP method for sending the request. | AbstractOperation | ||
name : String
The name of this Operation. | AbstractOperation | ||
operationManager : 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 | ||
properties : Object
This is a hook primarily for framework developers to register additional user
specified properties for your operation. | AbstractOperation | ||
request : Object
Object of name-value pairs used as parameters to the URL. | AbstractOperation | ||
requestTimeout : int
Provides access to the request timeout in seconds for sent messages. | AbstractOperation | ||
resultElementType : 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
Value that indicates how you want to deserialize the result
returned by the HTTP call. | AbstractOperation | ||
resultType : Class
Specifies an optional return type for the operation. | AbstractInvoker | ||
rootURL : String
The URL that the HTTPService object should use when computing relative URLs. | AbstractOperation | ||
serializationFilter : SerializationFilter
A SerializationFilter can control how the arguments are formatted to form the content
of the HTTP request. | AbstractOperation | ||
service : AbstractService [tylko do odczytu]
Provides convenient access to the service on which the Operation
is being invoked. | AbstractOperation | ||
showBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing. | AbstractOperation | ||
url : String
Location of the service. | AbstractOperation | ||
useProxy : Boolean
Specifies whether to use the Flex proxy service. | AbstractOperation | ||
xmlDecode : Function
ActionScript function used to decode a service result from XML. | AbstractOperation | ||
xmlEncode : Function
ActionScript function used to encode a service request as XML. | AbstractOperation |
Metoda | Zdefiniowane przez | ||
---|---|---|---|
Creates a new Operation. | AbstractOperation | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Rejestruje obiekt detektora zdarzeń w obiekcie EventDispatcher, dzięki czemu detektor będzie otrzymywał powiadomienia o zdarzeniu. | EventDispatcher | ||
Cancels the last service invocation or an invokation with the specified ID. | AbstractInvoker | ||
Sets the result property of the invoker to null. | AbstractInvoker | ||
Wywołuje zdarzenie, tj. kieruje je do przepływu zdarzeń. | EventDispatcher | ||
Sprawdza, czy obiekt EventDispatcher zawiera jakiekolwiek detektory zarejestrowane dla konkretnego typu zdarzeń. | EventDispatcher | ||
Wskazuje, czy dla obiektu zdefiniowano określoną właściwość. | Object | ||
Wskazuje, czy instancja klasy Object należy do łańcucha prototypów obiektu określonego jako parametr. | Object | ||
Wskazuje, czy określona właściwość istnieje i jest przeliczalna. | Object | ||
Usuwa detektor z obiektu EventDispatcher. | EventDispatcher | ||
Executes the method. | AbstractOperation | ||
AbstractOperation | |||
Ustawia dostępność właściwości dynamicznej używanej w pętlach. | Object | ||
This hook is exposed to update the lastResult property. | AbstractInvoker | ||
Zwraca ciąg reprezentujący obiekt — sformatowany zgodnie z konwencjami właściwymi dla ustawień regionalnych. | Object | ||
Zwraca ciąg reprezentujący określony obiekt. | Object | ||
Zwraca pierwotną wartość dla określonego obiektu. | Object | ||
Sprawdza, czy detektor zdarzeń określonego typu jest zarejestrowany w tym obiekcie EventDispatcher lub jego elementach macierzystych. | EventDispatcher |
Metoda | Zdefiniowane przez | ||
---|---|---|---|
Returns the HTTP request headers. | AbstractOperation | ||
Returns the serialization filter. | AbstractOperation |
argumentNames | właściwość |
public var argumentNames:Array
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
An ordered list of the names of the arguments to pass to a method invocation. Since the arguments object is a hashmap with no guaranteed ordering, this array helps put everything together correctly. It will be set automatically by the MXML compiler, if necessary, when the Operation is used in tag form.
concurrency | właściwość |
concurrency:String
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Value that indicates how to handle multiple calls to the same service. The default
value is multiple
. The following values are permitted:
multiple
Existing requests are not cancelled, and the developer is responsible for ensuring the consistency of returned data by carefully managing the event stream. This is the default value.single
Only a single request at a time is allowed on the operation; multiple requests generate a fault.last
Making a request cancels any existing request.
Implementacja
public function get concurrency():String
public function set concurrency(value:String):void
contentType | właściwość |
contentType:String
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
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.
Implementacja
public function get contentType():String
public function set contentType(value:String):void
headers | właściwość |
public var headers:Object
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Custom HTTP headers to be sent to the third party endpoint. If multiple headers need to be sent with the same name the value should be specified as an Array.
method | właściwość |
method:String
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
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
.
Implementacja
public function get method():String
public function set method(value:String):void
request | właściwość |
public var request:Object
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Object of name-value pairs used as parameters to the URL. If
the contentType
property is set to application/xml
, it should be an XML document.
requestTimeout | właściwość |
requestTimeout:int
Wersja języka: | ActionScript 3.0 |
Wersje produktu: | BlazeDS 4, Adobe Digital Enterprise Platform Data Services for Java EE 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Provides access to the request timeout in seconds for sent messages. If an acknowledgement, response or fault is not received from the remote destination before the timeout is reached the message is faulted on the client. A value less than or equal to zero prevents request timeout.
Implementacja
public function get requestTimeout():int
public function set requestTimeout(value:int):void
resultFormat | właściwość |
resultFormat:String
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Value that indicates how you want to deserialize the result returned by the HTTP call. The value for this is based on the following:
- Whether you are returning XML or name/value pairs.
- How you want to access the results; you can access results as an object, text, or XML.
The default value is object
. The following values are permitted:
object
The value returned is XML and is parsed as a tree of ActionScript objects. This is the default.array
The value returned is XML and is parsed as a tree of ActionScript objects however if the top level object is not an Array, a new Array is created and the result set as the first item. If makeObjectsBindable is true then the Array will be wrapped in an ArrayCollection.xml
The value returned is XML and is returned as literal XML in an ActionScript XMLnode object.flashvars
The value returned is text containing name=value pairs separated by ampersands, which is parsed into an ActionScript object.text
The value returned is text, and is left raw.e4x
The value returned is XML and is returned as literal XML in an ActionScript XML object, which can be accessed using ECMAScript for XML (E4X) expressions.
Implementacja
public function get resultFormat():String
public function set resultFormat(value:String):void
rootURL | właściwość |
rootURL:String
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
The URL that the HTTPService object should use when computing relative URLs.
This property is only used when going through the proxy.
When the useProxy
property is set to false
, the relative URL is computed automatically
based on the location of the SWF running this application.
If not set explicitly rootURL
is automatically set to the URL of
mx.messaging.config.LoaderConfig.url.
Implementacja
public function get rootURL():String
public function set rootURL(value:String):void
serializationFilter | właściwość |
public var serializationFilter:SerializationFilter
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
A SerializationFilter can control how the arguments are formatted to form the content of the HTTP request. It also controls how the results are converted into ActionScript objects. It can be set either explicitly using this property or indirectly using the resultFormat property.
showBusyCursor | właściwość |
showBusyCursor:Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
If true
, a busy cursor is displayed while a service is executing. The default
value is false
.
Implementacja
public function get showBusyCursor():Boolean
public function set showBusyCursor(value:Boolean):void
url | właściwość |
url:String
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Location of the service. If you specify the url
and a non-default destination,
your destination in the services-config.xml file must allow the specified URL.
Implementacja
public function get url():String
public function set url(value:String):void
useProxy | właściwość |
useProxy:Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
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
.
Wartością domyślną jest false.
Implementacja
public function get useProxy():Boolean
public function set useProxy(value:Boolean):void
xmlDecode | właściwość |
public var xmlDecode:Function
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
ActionScript function used to decode a service result from XML.
When the resultFormat
is an object and the xmlDecode
property is set,
Flex uses the XML that the HTTPService returns to create an
Object. If it is not defined the default XMLDecoder is used
to do the work.
The function referenced by the xmlDecode
property must
take a flash.xml.XMLNode object as a parameter and should return
an Object. It can return any type of object, but it must return
something. Returning null
or undefined
causes a fault.
<mx:HTTPService id="hs" xmlDecode="xmlDecoder" url="myURL" resultFormat="object" contentType="application/xml"> <mx:request><source/> <obj>{RequestObject}</obj> </mx:request> </mx:HTTPService>The following example shows an xmlDecoder function:
function xmlDecoder (myXML) { // Simplified decoding logic. var myObj = {}; myObj.name = myXML.firstChild.nodeValue; myObj.honorific = myXML.firstChild.attributes.honorific; return myObj; }
xmlEncode | właściwość |
public var xmlEncode:Function
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
ActionScript function used to encode a service request as XML.
When the contentType
of a request is application/xml
and the
request object passed in is an Object, Flex attempts to use
the function specified in the xmlEncode
property to turn it
into a flash.xml.XMLNode object If the xmlEncode
property is not set,
Flex uses the default
XMLEncoder to turn the object graph into a flash.xml.XMLNode object.
The xmlEncode
property takes an Object and should return
a flash.xml.XMLNode object. In this case, the XMLNode object can be a flash.xml.XML object,
which is a subclass of XMLNode, or the first child of the
flash.xml.XML object, which is what you get from an <mx:XML>
tag.
Returning the wrong type of object causes a fault.
The following example shows an <mx:HTTPService> tag that specifies an xmlEncode function:
<mx:HTTPService id="hs" xmlEncode="xmlEncoder" url="myURL" resultFormat="object" contentType="application/xml"> <mx:request><source/> <obj>{RequestObject}</obj> </mx:request> </mx:HTTPService>The following example shows an xmlEncoder function:
function xmlEncoder (myObj) { return new XML(""); }
AbstractOperation | () | Konstruktor |
public function AbstractOperation(service:AbstractService = null, name:String = null)
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 Creates a new Operation. |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Creates a new Operation.
Parametryservice:AbstractService (default = null ) — The object defining the type of service, such as
HTTPMultiService, WebService, or RemoteObject.
| |
name:String (default = null ) — The name of the service.
|
getHeaders | () | metoda |
protected function getHeaders():Object
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Returns the HTTP request headers. Subclasses can override this method to control the retrieval of the HTTP request headers.
ZwracaObject — The HTTP request headers.
|
getSerializationFilter | () | metoda |
protected function getSerializationFilter():SerializationFilter
Returns the serialization filter. Subclasses can override this method to control the retrieval of the HTTP request headers.
ZwracaSerializationFilter — The serialization filter.
|
sendBody | () | metoda |
public function sendBody(parameters:Object):mx.rpc:AsyncToken
Parametry
parameters:Object |
mx.rpc:AsyncToken |
Tue Jun 12 2018, 12:06 PM Z