Connecting to web services with the WebService
connector component (Flash Professional only)
The WebServiceConnector component lets you introspect, access, and bind data between a
remote web service and your Flash application. A single instance of a WebServiceConnector
component can be used to make multiple calls to the same operation. To call more than one
operation, use a different instance of a WebServiceConnector component for each operation.
For example, you would use one instance to connect to a DataSet component and another
instance to connect to a resolver component, as shown in the illustration in the overview at
the beginning of this chapter.
To use the WebServiceConnector component, you need to load the web service's schema into
the WebServiceConnector component. A web service's schema is defined by a Web Service
Description Language (WSDL) file. The WSDL file, which is accessible through a URL,
specifies a list of operations, parameters, and results that are exposed by the web service. Once
the schema is loaded, you can proceed to add data bindings.
You can load and view the schema of any web service by entering the URL into the
parameter of a WebServiceConnector component instance.
The following example demonstrates how to load and view the schema for a web service that
provides helpful tips for different products. You add a WebServiceConnector component
instance on the Stage, specify the web service to use, and view the web service's schema on the
Schema tab of the Component inspector.
This example requires an active Internet connection because it uses a public web
service. If you use a web service in your application, the web service must be located in
the same domain as the SWF file for your application so the application can work in a
web browser. For more information, see
Player" on page
1.
Drag a WebServiceConnector component to the Stage and name it
2.
In the Component inspector, click the Parameters tab, if not already selected.
3.
Select the
WSDLURL
http://www.flash-mx.com/mm/tips/tips.cfc?WSDL
When you specify a web service for a WebServiceConnector component in this way, it is
automatically added to the Web Services panel and is available to any application you
create.
4.
Select Operation, and select the
418.
parameter, and type the following URL:
getTipByProduct
"About data connectivity and security in Flash
method.
Data connectivity (Flash Professional only)
WSDLURL
.
tipsWSC
413
Need help?
Do you have a question about the FLASH 8-USING FLASH and is the answer not in the manual?