| 套件 | mx.rpc.http | 
| 類別 | public dynamic class HTTPMultiService | 
| 繼承 | HTTPMultiService    AbstractService   Proxy | 
| 子類別 | HTTPMultiService | 
| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
<mx:HTTPMultiService> tag to represent a
  collection of http operations.  Each one has a URL, method, parameters and
  return type.  
 
  You can set attributes such as the URL and method on the
  HTTPMultiService tag to act as defaults for values set on each individual
  operation tag.  The URL of the HTTPMultiService serves as the base url (meaning the prefix)
  for any relative urls set on the http operation tags.
  Each http operation has a send() method, which makes an HTTP request to the
  specified URL, and an HTTP response is returned. 
You can pass parameters to the specified URL which are used to put data into the HTTP request. The contentType property specifies a mime-type which is used to determine the over-the-wire data format (such as HTTP form encoding or XML).
You can also use a serialization filter to
  implement a custom resultFormat such as JSON.   
  When you do not go through the server-based
  proxy service, you can use only HTTP GET or POST methods. However, when you set
  the useProxy  property to true and you use the server-based proxy service, you
  can also use the HTTP HEAD, OPTIONS, TRACE, and DELETE methods.
                  Note: Unlike the HTTPService class, the HTTPMultiService class does not 
  define a request property.
Note: Due to a software limitation, like HTTPService, the HTTPMultiService does not generate user-friendly error messages when using GET and not using a proxy.
預設 MXML 屬性operationList
相關 API 元素
| 屬性 | 定義自 | ||
|---|---|---|---|
| baseURL : String 
      The URL that the HTTPService object should use when computing relative URLs.  | HTTPMultiService | ||
![]()  | channelSet : ChannelSet 
      Provides access to the ChannelSet used by the service.  | AbstractService | |
| concurrency : String 
     Value that indicates how to handle multiple calls to the same operation within the service.  | HTTPMultiService | ||
| contentType : String = "application/x-www-form-urlencoded" 
      Type of content for service requests.  | HTTPMultiService | ||
![]()  | destination : String 
     The destination of the service.  | AbstractService | |
| headers : Object 
      Custom HTTP headers to be sent to the third party endpoint.  | HTTPMultiService | ||
| makeObjectsBindable : Boolean = true 
      When true, the objects returned support data binding to UI controls.  | HTTPMultiService | ||
![]()  | managers : Array 
     The managers property stores a list of data managers which modify the
     behavior of this service.  | AbstractService | |
| method : String = "GET" 
      HTTP method for sending the request if a method is not set explicit on the operation.  | HTTPMultiService | ||
| operationList : Array 
     This serves as the default property for this instance so that we can
     define a set of operations as direct children of the HTTPMultiService
     tag in MXML.  | HTTPMultiService | ||
![]()  | operations : Object 
     The Operations array is usually only set by the MXML compiler if you
     create a service using an MXML tag.  | AbstractService | |
![]()  | requestTimeout : int 
      Provides access to the request timeout in seconds for sent messages.  | AbstractService | |
| resultFormat : String 
      Value that indicates how you want to deserialize the result
      returned by the HTTP call.  | HTTPMultiService | ||
| serializationFilter : SerializationFilter  Default serializationFilter used by all operations which do not set one explicitly   | HTTPMultiService | ||
| showBusyCursor : Boolean 
    If true, a busy cursor is displayed while a service is executing.  | HTTPMultiService | ||
| useProxy : Boolean 
      Specifies whether to use the Flex proxy service.  | HTTPMultiService | ||
| 方法 | 定義自 | ||
|---|---|---|---|
      Creates a new HTTPService.  | HTTPMultiService | ||
![]()  | 
      Disconnects the service's network connection and removes any pending
      request responders.  | AbstractService | |
![]()  | 
     Returns an Operation of the given name.  | AbstractService | |
![]()  | 
      Called to initialize the service.  | AbstractService | |
![]()  | 
     Logs the user out of the destination.  | AbstractService | |
![]()  | 
     Sets the credentials for the destination accessed by the service when using Data Services on the server side.  | AbstractService | |
![]()  | 
     The username and password to be used to authenticate a user when
     accessing a remote, third-party endpoint such as a web service through a
     proxy or a remote object through a custom adapter when using Data Services on the server side.  | AbstractService | |
| 事件 | 摘要 | 定義自 | ||
|---|---|---|---|---|
| Dispatched when an HTTPMultiService call fails. | HTTPMultiService | |||
| The invoke event is fired when an HTTPMultiService call is invoked so long as an Error is not thrown before the Channel attempts to send the message. | HTTPMultiService | |||
| Dispatched when an HTTPMultiService call returns successfully. | HTTPMultiService | |||
baseURL | 屬性 | 
public var baseURL:String| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
The URL that the HTTPService object should use when computing relative URLs. This contains a prefix which is prepended onto any URLs when it is set. It defaults to null in which case the URL for the SWF is used to compute relative URLs.
concurrency | 屬性 | 
concurrency:String| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
     Value that indicates how to handle multiple calls to the same operation within the service.
     The concurrency setting set here will be used for operations that do not specify concurrecny.
     Individual operations that have the concurrency setting set directly will ignore the value set here.
     The default value is multiple. The following values are permitted:
     
multipleExisting 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.singleOnly a single request at a time is allowed on the operation; multiple requests generate a fault.lastMaking a request cancels any existing request.
實作
    public function get concurrency():String    public function set concurrency(value:String):voidcontentType | 屬性 | 
public var contentType:String = "application/x-www-form-urlencoded"
      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.
     
headers | 屬性 | 
public var headers:Object| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | 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. These headers are sent to all operations. You can also set headers at the operation level.
makeObjectsBindable | 屬性 | 
public var makeObjectsBindable:Boolean = true| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
      When true, the objects returned support data binding to UI controls.
      That means  they send PropertyChangeEvents when their property values are being changed.  
      This is the default value for any operations whose makeObjectsBindable property 
      is not set explicitly.
      
      
method | 屬性 | 
public var method:String = "GET"| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
      HTTP method for sending the request if a method is not set explicit on the operation. 
      Permitted values are GET, POST, HEAD,
      OPTIONS, PUT, TRACE and DELETE.
      Lowercase letters are converted to uppercase letters. The default value is GET.
      
      
operationList | 屬性 | 
operationList:Array| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
This serves as the default property for this instance so that we can define a set of operations as direct children of the HTTPMultiService tag in MXML.
實作
    public function get operationList():Array    public function set operationList(value:Array):voidresultFormat | 屬性 | 
resultFormat:String| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | 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:
objectThe value returned is XML and is parsed as a tree of ActionScript objects. This is the default.arrayThe 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.xmlThe value returned is XML and is returned as literal XML in an ActionScript XMLnode object.flashvarsThe value returned is text containing name=value pairs separated by ampersands, which is parsed into an ActionScript object.textThe value returned is text, and is left raw.e4xThe 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.
實作
    public function get resultFormat():String    public function set resultFormat(value:String):voidserializationFilter | 屬性 | 
public var serializationFilter:SerializationFilterDefault serializationFilter used by all operations which do not set one explicitly
showBusyCursor | 屬性 | 
useProxy | 屬性 | 
useProxy:Boolean| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | 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.
     
      
 預設值為 false。
實作
    public function get useProxy():Boolean    public function set useProxy(value:Boolean):voidHTTPMultiService | () | 建構函式 | 
public function HTTPMultiService(baseURL:String = null, destination:String = null)| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
      Creates a new HTTPService. If you expect the service to send using relative URLs you may
      wish to specify the baseURL that will be the basis for determining the full URL (one example
      would be Application.application.url).
     
      
baseURL:String (default = null) — The URL the HTTPService should use when computing relative URLS.
      
       | |
destination:String (default = null) | 
fault | 事件 | 
mx.rpc.events.FaultEvent屬性 FaultEvent.type =
mx.rpc.events.FaultEvent.FAULT| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
Dispatched when an HTTPMultiService call fails.
The FAULT event type.The properties of the event object have the following values:
| Property | Value | 
|---|---|
bubbles | false | 
cancelable | true, calling preventDefault() from the associated token's responder.fault method will prevent the service or operation from dispatching this event | 
currentTarget | The Object that defines the 
          event listener that handles the event. For example, if you use 
          myButton.addEventListener() to register an event listener, 
          myButton is the value of the currentTarget.  | 
fault | The Fault object that contains the details of what caused this event. | 
message | The Message associated with this event. | 
target | The Object that dispatched the event; 
          it is not always the Object listening for the event. 
          Use the currentTarget property to always access the 
          Object listening for the event. | 
token | The token that represents the call to the method. Used in the asynchronous completion token pattern. | 
invoke | 事件 | 
mx.rpc.events.InvokeEvent屬性 InvokeEvent.type =
mx.rpc.events.InvokeEvent.INVOKE| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
The invoke event is fired when an HTTPMultiService call is invoked so long as an Error is not thrown before the Channel attempts to send the message.
The INVOKE event type.The properties of the event object have the following values:
| Property | Value | 
|---|---|
bubbles | false | 
token | The token that represents the indiviudal call to the method. Used in the asynchronous completion token pattern. | 
cancelable | true | 
currentTarget | The Object that defines the 
           event listener that handles the event. For example, if you use 
           myButton.addEventListener() to register an event listener, 
           myButton is the value of the currentTarget.  | 
message | The request Message associated with this event. | 
target | The Object that dispatched the event; 
           it is not always the Object listening for the event. 
           Use the currentTarget property to always access the 
           Object listening for the event. | 
result | 事件 | 
mx.rpc.events.ResultEvent屬性 ResultEvent.type =
mx.rpc.events.ResultEvent.RESULT| 語言版本: | ActionScript 3.0 | 
| 產品版本: | Flex 3 | 
| 執行階段版本: | Flash Player 9, AIR 1.1 | 
Dispatched when an HTTPMultiService call returns successfully.
The RESULT event type.The properties of the event object have the following values:
| Property | Value | 
|---|---|
bubbles | false | 
cancelable | true, preventDefault() from the associated token's responder.result method will prevent the service or operation from dispatching this event | 
currentTarget | The Object that defines the 
          event listener that handles the event. For example, if you use 
          myButton.addEventListener() to register an event listener, 
          myButton is the value of the currentTarget.  | 
message | The Message associated with this event. | 
target | The Object that dispatched the event; 
          it is not always the Object listening for the event. 
          Use the currentTarget property to always access the 
          Object listening for the event. | 
result | Result that the RPC call returns. | 
token | The token that represents the indiviudal call to the method. Used in the asynchronous completion token pattern. | 
Tue Jun 12 2018, 03:47 PM Z
 
 隱藏繼承公用屬性
 顯示繼承公用屬性