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.
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.
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.
Implementation public function get channelSet():ChannelSet public function set channelSet(value:ChannelSet):void
destination
property
destination:String
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
The destination of the service. This value should match a destination
entry in the services-config.xml file.
Implementation public function get destination():String public function set destination(value:String):void
keepLastResult
property
keepLastResult:Boolean
Product Version :
Flex 4.11
Runtime Versions :
Flash Player 10, AIR 3
Flag indicating whether the service's operations should keep their last call result for later access.
Setting this flag at the service level will set keepLastResult for each operation, unless explicitly set in the operation.
If set to true or not set, each operation's last call result will be accessible through its lastResult bindable property.
If set to false, each operation's last call result will be cleared after the call,
and must be processed in the operation's result handler.
This will allow the result object to be garbage collected,
which is especially useful if the operation is only called a few times and returns a large result.
The default value is true.
Implementation public function get keepLastResult():Boolean public function set keepLastResult(value:Boolean):void
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.
Implementation public function get managers():Array public function set managers(value:Array):void
operations
property
operations:Object
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
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.
Implementation public function get operations():Object public function set operations(value:Object):void
requestTimeout
property
requestTimeout:int
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
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.
Implementation public function get requestTimeout():int public function set requestTimeout(value:int):void
Constructor Detail
AbstractService
()
Constructor
public function AbstractService(destination:String = null)
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Constructor.
Parameters
destination:String (default = null) — The destination of the service.
Method Detail
disconnect
()
method
public function disconnect():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
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.
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.
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.
public function setCredentials(username:String, password:String, charset:String = null):void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
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.
Parameters
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
()
method
public function setRemoteCredentials(remoteUsername:String, remotePassword:String, charset:String = null):void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
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.
Parameters
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".
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:
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.
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:
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.
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:
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.