MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 860

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Usage
myWebServiceObject = new WebService(wsdlURI [, logObject]);
Parameters
The URI of the web service WSDL file.
wsdlURI
An optional parameter specifying the name of the Log object for this web service. If
logObject
this parameter is used, the Log object must be created first. For more information, see
(Flash Professional only)" on page
Returns
Nothing.
Description
Constructor function; creates a WebService object. When you call
provide a WSDL URL, and Flash Player returns a WebService object. The constructor can
optionally accept a proxy URI and a Log object.
If you want, you can use two callbacks for the WebService object. Flash Player calls
webServiceObject.onLoad
This is a good place to put code you want to execute only after the WSDL file has been
completely parsed. For example, you might choose to put your first web service method call in
this function.
Flash Player calls
WSDL file. This is a good place to put debugging code and code that tells users that the server is
unavailable, that they should try again later, or similar information. For more information, see the
individual entries for these functions.
Invoking a web service operation
available on the web service. For example, if your web service has the method
getCompanyInfo(tickerSymbol)
myPendingCallObject = myWebServiceObject.getCompanyInfo(tickerSymbol);
In this example, the callback object is named
asynchronous, and return a callback object of type
results of the web service call are not available immediately.)
Consider the following call:
x = stockService.getQuote("macr");
When you make this call, the object
actual results are only available later, when the web service operation completes. Your
ActionScript code is notified by a call to the
Handling the PendingCall object
handling the results and errors from the web service method that was called (see
class (Flash Professional only)" on page
MyPendingCallObject = myWebServiceObject.myMethodName(param1, ..., paramN);
MyPendingCallObject.onResult = function(result)
860
Chapter 6: Components Dictionary
842.
when it finishes parsing the WSDL file and the object is complete.
webServiceObject.onFault
You invoke a web service operation as a method directly
, you would invoke the method in the following manner:
is not the result of
x
This callback object is a PendingCall object that you use for
when an error occurs in finding or parsing the
myPendingCallObject
PendingCall
getQuote
callback function.
onResult
845). Here is an example:
new WebService()
. All method invocations are
. (Asynchronous means that the
; it's a PendingCall object. The
"PendingCall
"Log class
, you

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents