User Guide
1442 Web service classes (Flash Professional only)
Parameters
wsdlURI The URI of the web service WSDL file.
logObject An optional parameter specifying the name of the Log object for this web
service. If this parameter is used, the Log object must be created first. For more information,
see “Log class (Flash Professional only)” on page 1414.
Returns
Nothing.
Description
Constructor function; creates a WebService object. When you call new WebService(), you
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 when it finishes parsing the WSDL file and the object is
complete. 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
webServiceObject.onFault when an error occurs in finding or parsing the
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 You invoke a web service operation as a method directly
available on the web service. For example, if your web service has the method
getCompanyInfo(tickerSymbol), you would invoke the method in the following manner:
myPendingCallObject = myWebServiceObject.getCompanyInfo(tickerSymbol);
In this example, the callback object is named myPendingCallObject. All method invocations
are asynchronous, and return a callback object of type
PendingCall. (Asynchronous means
that the 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 x is not the result of getQuote; it’s a PendingCall object.
The actual results are only available later, when the web service operation completes. Your
ActionScript code is notified by a call to the
onResult callback function.