Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Web service classes > PendingCall class | |||
ActionScript Class Name mx.services.PendingCall
The PendingCall class is part of the mx.services package and is used with the WebService class. For an overview of the classes in the mx.services package, see Web service classes.
|
NOTE |
|
The PendingCall class is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings. |
You don't create a PendingCall object or use a constructor function; instead, when you call a method on a WebService object, the WebService method returns a PendingCall object. You use the PendingCall.onResult and PendingCall.onFault callback functions to handle the asynchronous response from the web service method. If the web service method returns a fault, Flash Player calls PendingCall.onFault and passes a SOAPFault object that represents the XML SOAP fault returned by the server or web service. A SOAPFault object is not constructed directly by you, but is returned as the result of a failure. This object is an ActionScript mapping of the SOAPFault XML type.
If the web service invocation is successful, Flash Player calls PendingCall.onResult and passes a result object. The result object is the XML response from the web service, decoded or deserialized into ActionScript. For more information about the WebService object, see WebService class.
The PendingCall object also gives you access to multiple output parameters when the web service method returns more than one result. The "return value" referred to in this API is simply the first (or only) result; to gain access to all of the results, you can use the "get output" functions. For example, if the return value delivered to you in the parameter to the onResult callback is not the only result you want to access, you can use getOutputValues() (which returns an array) or getOutputValue() (which returns an individual value) to get the ActionScript decoded values.
You can also access the SOAPParameter object directly. The SOAPParameter object is an ActionScript object with two properties: value (the output parameter's ActionScript value) and element (the output parameter's XML value). The following functions return a SOAPParameter object, or an array of SOAPParameter objects: getOutputParameters(), getOutputParameterByName(), and getOutputParameter().
The following table lists methods of the PendingCall class.
|
Method |
Description |
|---|---|
|
Retrieves a SOAPParameter object by index. |
|
|
Retrieves a SOAPParameter object by name. |
|
|
Retrieves an array of SOAPParameter objects. |
|
|
Retrieves the output value according to the specified index. |
|
|
Retrieves an array of all the output values. |
The following table lists properties of the PendingCall class.
|
Property |
Description |
|---|---|
|
The SOAPCall operation descriptor for the PendingCall operation. |
|
|
The SOAP request in raw XML format. |
|
|
The SOAP response in raw XML format. |
The following table lists the callbacks of the PendingCall class.
|
Callback |
Description |
|---|---|
|
Called by Flash Player when a web service method has failed and returned an error. |
|
|
Called when a method has succeeded and returned a result. |
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00003708.html