適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
mx.rpc 

AbstractService  - AS3 Flex

套件mx.rpc
類別public dynamic class AbstractService
繼承AbstractService Inheritance Proxy
實作 IEventDispatcher
子類別 AbstractWebService, HTTPMultiService, ManagedRemoteService, RemoteObject

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The AbstractService class is the base class for the HTTPMultiService, WebService, and RemoteObject classes. This class does the work of creating Operations which do the actual execution of remote procedure calls.



公用屬性
 屬性定義自
  channelSet : ChannelSet
Provides access to the ChannelSet used by the service.
AbstractService
  destination : String
The destination of the service.
AbstractService
  managers : Array
The managers property stores a list of data managers which modify the behavior of this service.
AbstractService
  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
公用方法
 方法定義自
  
AbstractService(destination:String = null)
Constructor.
AbstractService
  
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
  
setCredentials(username:String, password:String, charset:String = null):void
Sets the credentials for the destination accessed by the service when using Data Services on the server side.
AbstractService
  
setRemoteCredentials(remoteUsername:String, remotePassword:String, charset:String = null):void
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
事件
 事件 摘要 定義自
  The fault event is dispatched when a service call fails and isn't handled by the Operation itself.AbstractService
  The invoke event is dispatched when a service Operation is invoked so long as an Error is not thrown before the Channel attempts to send the message.AbstractService
  The result event is dispatched when a service call successfully returns and isn't handled by the Operation itself.AbstractService
屬性詳細資訊

channelSet

屬性
channelSet:ChannelSet

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Provides access to the ChannelSet used by the service. The ChannelSet can be manually constructed and assigned, or it will be dynamically created to use the configured Channels for the destination for this service.



實作
    public function get channelSet():ChannelSet
    public function set channelSet(value:ChannelSet):void

destination

屬性 
destination:String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The destination of the service. This value should match a destination entry in the services-config.xml file.



實作
    public function get destination():String
    public function set destination(value:String):void

managers

屬性 
managers:Array

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The managers property stores a list of data managers which modify the behavior of this service. You can use this hook to define one or more manager components associated with this service. When this property is set, if the managers have a property called "service" that property is set to the value of this service. When this service is initialized, we also call the initialize method on any manager components.



實作
    public function get managers():Array
    public function set managers(value:Array):void

operations

屬性 
operations:Object

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The Operations array is usually only set by the MXML compiler if you create a service using an MXML tag.



實作
    public function get operations():Object
    public function set operations(value:Object):void

requestTimeout

屬性 
requestTimeout:int

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Provides access to the request timeout in seconds for sent messages. A value less than or equal to zero prevents request timeout.



實作
    public function get requestTimeout():int
    public function set requestTimeout(value:int):void
建構函式詳細資料

AbstractService

()建構函式
public function AbstractService(destination:String = null)

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constructor.

參數
destination:String (default = null) — The destination of the service.
方法詳細資訊

disconnect

()方法
public function disconnect():void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Disconnects the service's network connection and removes any pending request responders. This method does not wait for outstanding network operations to complete.

getOperation

()方法 
public function getOperation(name:String):AbstractOperation

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Returns an Operation of the given name. If the Operation wasn't created beforehand, subclasses are responsible for creating it during this call. Operations are usually accessible by simply naming them after the service variable (myService.someOperation), but if your Operation name happens to match a defined method on the service (like setCredentials), you can use this method to get the Operation instead.

參數

name:String — Name of the Operation.

傳回值
AbstractOperation — Operation that executes for this name.

initialize

()方法 
public function initialize():void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Called to initialize the service.

logout

()方法 
public function logout():void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Logs the user out of the destination. Logging out of a destination applies to everything connected using the same ChannelSet as specified in the server configuration. For example, if you're connected over the my-rtmp channel and you log out using one of your RPC components, anything that was connected over the same ChannelSet is logged out.

Note: Adobe recommends that you use the mx.messaging.ChannelSet.logout() method rather than this method.

相關 API 元素

setCredentials

()方法 
public function setCredentials(username:String, password:String, charset:String = null):void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Sets the credentials for the destination accessed by the service when using Data Services on the server side. The credentials are applied to all services connected over the same ChannelSet. Note that services that use a proxy or a third-party adapter to a remote endpoint will need to setRemoteCredentials instead.

參數

username:String — The username for the destination.
 
password:String — The password for the destination.
 
charset:String (default = null) — The character set encoding to use while encoding the credentials. The default is null, which implies the legacy charset of ISO-Latin-1. The only other supported charset is "UTF-8".

setRemoteCredentials

()方法 
public function setRemoteCredentials(remoteUsername:String, remotePassword:String, charset:String = null):void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

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.

參數

remoteUsername:String — The username to pass to the remote endpoint
 
remotePassword:String — The password to pass to the remote endpoint
 
charset:String (default = null) — The character set encoding to use while encoding the remote credentials. The default is null, which implies the legacy charset of ISO-Latin-1. The only other supported charset is "UTF-8".

事件詳細資訊

fault

事件
事件物件類型: mx.rpc.events.FaultEvent
屬性 FaultEvent.type = mx.rpc.events.FaultEvent.FAULT

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The fault event is dispatched when a service call fails and isn't handled by the Operation itself.

The FAULT event type.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelabletrue, calling preventDefault() from the associated token's responder.fault method will prevent the service or operation from dispatching this event
currentTargetThe 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.
faultThe Fault object that contains the details of what caused this event.
messageThe Message associated with this event.
targetThe 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.
tokenThe 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 dispatched when a service Operation 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:

PropertyValue
bubblesfalse
token The token that represents the indiviudal call to the method. Used in the asynchronous completion token pattern.
cancelabletrue
currentTargetThe 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.
targetThe 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

The result event is dispatched when a service call successfully returns and isn't handled by the Operation itself.

The RESULT event type.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelabletrue, preventDefault() from the associated token's responder.result method will prevent the service or operation from dispatching this event
currentTargetThe 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.
targetThe 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.
resultResult that the RPC call returns.
tokenThe token that represents the indiviudal call to the method. Used in the asynchronous completion token pattern.




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。