Packageorg.orpheus.xml.bind.mxml
Classpublic class XMLService
InheritanceXMLService Inheritance XMLService Inheritance mx.rpc.http.HTTPService
Implementsmx.core.IMXMLObject, mx.rpc.mxml.IMXMLSupport

You use the <mxml:XMLService> tag to represent an XMLService object in an MXML file. When you call the XMLService object's send() method, it makes an HTTP request to the specified URL, and an HTTP response is returned. Optionally, you can pass parameters to the specified URL. 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: Due to a software limitation, XMLService does not generate user-friendly error messages when using GET.

MXML Syntaxexpanded Hide MXML Syntax

The <mxml:XMLService> tag accepts the following tag attributes:

 <mxml:XMLService
 Properties
 concurrency="multiple|single|last"
 contentType="application/x-www-form-urlencoded|application/xml"
 destination="DefaultHTTP"
 id="No default."
 method="GET|POST|HEAD|OPTIONS|PUT|TRACE|DELETE"
 resultFormat="object|array|xml|e4x|flashvars|text"
 showBusyCursor="false|true"
 makeObjectsBindable="false|true"
 url="No default."
 useProxy="false|true"
 xmlEncode="No default."
 xmlDecode="No default."
  Events
 fault="No default."
 result="No default."
 />
 
The <mxml:XMLService> tag can have a single <mx:request> tag under which the parameters can be specified.

Author: Andrew Lewisohn
Version: $Revision: 31 $, $Date: 2009-02-12 17:01:41 -0500 (Thu, 12 Feb 2009) $, $Author: alewisohn $
Since: 0.1

See also

org.orpheus.xml.bind.XMLService
mx.rpc.http.mxml.HTTPService


Public Properties
 PropertyDefined by
  concurrency : String
Value that indicates how to handle multiple calls to the same service.
XMLService
  showBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing.
XMLService
Public Methods
 MethodDefined by
  
XMLService(context:IEvaluationContext = null, rootURL:String = null, destination:String = null)
Creates a new XMLService.
XMLService
  
initialized(document:Object, id:String):void
Called after the implementing object has been created and all component properties specified on the MXML tag have been initialized.
XMLService
 Inherited
registerClass(type:Object, definition:Object):void
Registers the class (type) of an object for when the object is encoded/decoded to/from XML.
XMLService
  
send(parameters:Object = null):AsyncToken
Executes an XMLService request.
XMLService
 Inherited
unregisterClass(type:Object):void
Unregister the class (type) of an object so that it is no longer available when encoding/decoding to/from XML.
XMLService
Public Constants
 ConstantDefined by
 InheritedERROR_MARSHALLING : String = "Client.CouldNotMarshal"
[static] Indicates that an ActionScript Object could not be marshalled into an XML definition.
XMLService
 InheritedERROR_UNMARSHALLING : String = "Client.CouldNotUnmarshal"
[static] Indicates that an XML formatted result could not be unmarshalled into an ActionScript Object.
XMLService
Property detail
concurrencyproperty
concurrency:String  [read-write]

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

Implementation
    public function get concurrency():String
    public function set concurrency(value:String):void
showBusyCursorproperty 
showBusyCursor:Boolean  [read-write]

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
Constructor detail
XMLService()constructor
public function XMLService(context:IEvaluationContext = null, rootURL:String = null, destination:String = null)

Creates a new XMLService. This constructor is usually called by the generated code of an MXML document. You usually use the org.orpheus.xml.bind.XMLService class to create an XMLService in ActionScript.

Parameters
context:IEvaluationContext (default = null) — The URL the XMLService should use when computing relative URLS.
 
rootURL:String (default = null) — An XMLService destination name in the service-config.xml file.
 
destination:String (default = null)
Method detail
initialized()method
public function initialized(document:Object, id:String):void

Called after the implementing object has been created and all component properties specified on the MXML tag have been initialized. If you create this class in ActionScript and want it to function with validation, you must call this method and pass in the MXML document and the XMLService's id.

Parameters
document:Object — The MXML document that created this object.
 
id:String — The identifier used by document to refer to this object. If the object is a deep property on document, id is null.
send()method 
public override function send(parameters:Object = null):AsyncToken

Executes an XMLService request. The parameters are optional, but if specified should be an ActionScript Object.

Parameters
parameters:Object (default = null)

Returns
AsyncToken — an AsyncToken. It will be the same object available in the result or fault event's token property.