Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
WebService

Package | mx.rpc.soap
Class | public dynamic class WebService
Inheritance | WebService AbstractWebService AbstractService flash.utils.Proxy
Subclasses | WebService

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

The WebService class provides access to SOAP-based web services on remote servers.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | channelSet : ChannelSet Provides access to the ChannelSet used by the service. | AbstractService
|  | convertParametersHandler : Function An optional function, primarily intended for framework developers who need to install a function to get called with the parameters passed to each webservice operation invocation. | AbstractWebService
|  | convertResultHandler : Function An optional function, primarily intended for framework developers who need to install a hook to process the results of an operation before notifying the result handlers. | AbstractWebService
|  | description : String The description of the service for the currently active port. | AbstractWebService
|  | destination : String [override] The destination of the service. | AbstractWebService
|  | endpointURI : String The location of the WebService. | AbstractWebService
|  | headers : Array [read-only] Returns the array of SOAPHeaders registered for the WebService. | AbstractWebService
|  | httpHeaders : Object Custom HTTP headers to be sent to the SOAP endpoint. | AbstractWebService
|  | keepLastResult : Boolean Flag indicating whether the service's operations should keep their last call result for later access. | AbstractService
|  | makeObjectsBindable : Boolean When this value is true, anonymous objects returned are forced to bindable objects. | AbstractWebService
|  | 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
|  | port : String Specifies the port within the WSDL document that this WebService should use. | AbstractWebService
|  | ready : Boolean [read-only] Specifies whether the WebService is ready to make requests. | AbstractWebService
|  | requestTimeout : int Provides access to the request timeout in seconds for sent messages. | AbstractService
|  | rootURL : String The URL that the WebService should use when computing relative URLs. | AbstractWebService
|  | service : String Specifies the service within the WSDL document that this WebService should use. | AbstractWebService
|  | useProxy : Boolean Specifies whether to use the Flex proxy service. | AbstractWebService
|  | wsdl : String The location of the WSDL document for this WebService. | WebService
|  | xmlSpecialCharsFilter : Function Custom function to be used to escape XML special characters before encoding any simple content. | AbstractWebService

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | _keepLastResult : Boolean = true | AbstractService

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | WebService(destination:String = null, rootURL:String = null) Creates a new WebService. | WebService
|  | addHeader(header:Object):void Adds a header that will be applied to all operations of this web service. | AbstractWebService
|  | addSimpleHeader(qnameLocal:String, qnameNamespace:String, headerName:String, headerValue:String):void Add a header that will be applied to all operations of this WebService. | AbstractWebService
|  | canLoadWSDL():Boolean Returns a Boolean value that indicates whether the WebService is ready to load a WSDL (does it have a valid destination or wsdl specified). | WebService
|  | clearHeaders():void Clears the headers that applied to all operations. | AbstractWebService
|  | disconnect():void Disconnects the service's network connection and removes any pending request responders. | AbstractService
|  | getHeader(qname:QName, headerName:String = null):SOAPHeader Returns a header if a match is found based on QName, localName, and URI. | AbstractWebService
|  | getOperation(name:String):AbstractOperation [override] Returns an Operation of the given name. | WebService
|  | initialize():void Called to initialize the service. | AbstractService
|  | loadWSDL(uri:String = null):void Instructs the WebService to download the WSDL document. | WebService
|  | logout():void Logs the user out of the destination. | AbstractService
|  | removeHeader(qname:QName, headerName:String = null):void Removes the header with the given QName from all operations. | AbstractWebService
|  | 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 [override] The username and password to authenticate a user when accessing the webservice. | AbstractWebService
|  | toString():String Represents an instance of WebService as a String, describing important properties such as the destination id and the set of channels assigned. | WebService

Protected Methods

| Method | Defined By
--- | --- | ---
|  | initializeOperation(operation:Operation):void Initializes a new Operation. | WebService

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | fault | The fault event is dispatched when a service call fails and isn't handled by the Operation itself. | AbstractService
|  | invoke | 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
|  | load | The LoadEvent.LOAD is dispatched when the WSDL document has loaded successfully. | WebService
|  | result | The result event is dispatched when a service call successfully returns and isn't handled by the Operation itself. | AbstractService

Public Constants

| Constant | Defined By
--- | --- | ---
|  | DEFAULT_DESTINATION_HTTP : String = DefaultHTTP [static] | WebService
|  | DEFAULT_DESTINATION_HTTPS : String = DefaultHTTPS [static] | WebService

Property Detail

wsdl | property

`wsdl:String`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

The location of the WSDL document for this WebService. If you use a relative URL, make sure that the `rootURL` has been specified or that you created the WebService in MXML.

Implementation
`public function get wsdl():String`
`public function set wsdl(value:String):void`
Constructor Detail

WebService | () | Constructor

`public function WebService(destination:String = null, rootURL:String = null)`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Creates a new WebService. The destination, if specified, should match an entry in services-config.xml. If unspecified, the WebService uses the DefaultHTTP destination. The `rootURL` is required if you intend to use a relative URL to find the WSDL document for this WebService.

Parameters

| `destination:String` (default = `null`)`` — The destination of the WebService, should match a destination name in the services-config.xml file.
| `rootURL:String` (default = `null`)`` — The root URL of the WebService.

Method Detail

canLoadWSDL | () | method

`public function canLoadWSDL():Boolean`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Returns a Boolean value that indicates whether the WebService is ready to load a WSDL (does it have a valid destination or wsdl specified).

Returns

| `Boolean` — Returns `true` if the WebService is ready to load a WSDL; otherwise, returns `false`.

getOperation | () | method |

`override public function getOperation(name:String):AbstractOperation`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Returns an Operation of the given name. If the Operation wasn't created beforehand, a new `mx.rpc.soap.Operation` is created 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.

Parameters

| `name:String` — Name of the Operation.

Returns

| `AbstractOperation` — Operation that executes for this name.

initializeOperation | () | method |

`protected function initializeOperation(operation:Operation):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Initializes a new Operation.

Parameters

| `operation:Operation` — The Operation to initialize.

loadWSDL | () | method |

`public function loadWSDL(uri:String = null):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Instructs the WebService to download the WSDL document. The WebService calls this method automatically WebService when specified in the WebService MXML tag, but it must be called manually if you create the WebService object in ActionScript after you have specified the `destination` or `wsdl` property value.

Parameters

| `uri:String` (default = `null`)`` — If the wsdl hasn't been specified previously, it may be specified here.

toString | () | method |

`public function toString():String`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Represents an instance of WebService as a String, describing important properties such as the destination id and the set of channels assigned.

Returns

| `String` — Returns a String representation of the WebService.

Event Detail

load | Event

Event Object Type: `mx.rpc.soap.LoadEvent`
LoadEvent.type property = `mx.rpc.soap.LoadEvent.LOAD`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

The `LoadEvent.LOAD` is dispatched when the WSDL document has loaded successfully.

The `LOAD` constant defines the value of the `type` property of the event object for a `load` event.

The properties of the event object have the following values:

Property | Value
--- | ---
`bubbles` | false
`cancelable` | true
`wsdl` | WSDL object.
`location` | URI of the WSDL document

Constant Detail

DEFAULT_DESTINATION_HTTP | Constant

`public static const DEFAULT_DESTINATION_HTTP:String = DefaultHTTP`

DEFAULT_DESTINATION_HTTPS | Constant |

`public static const DEFAULT_DESTINATION_HTTPS:String = DefaultHTTPS`

Wed Nov 15 2017, 09:50 AM +01:00