User Guide
Web service classes (Flash Professional only) 845
mytrace("Log Event:\r myWebSrvcLog.message="+message+);
}
PendingCall class (Flash Professional only)
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 (Flash
Professional only)” on page 842.
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
(Flash Professional only)” on page 856.
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().
Method summary for the PendingCall class
The following table lists methods of the PendingCall class.
Method Description
PendingCall.getOutputParameter() Retrieves a SOAPParameter object by index.
PendingCall.getOutputParameterByName() Retrieves a SOAPParameter object by name.
PendingCall.getOutputParameters() Retrieves an array of SOAPParameter objects.