Macromedia flex builder-using flex builder 用户手册

下载
页码 158
Working with Flex data services
137
HTTP Service
 inserts a service that lets you retrieve data from an HTTP address.
Remote Object
 inserts a service that lets you access the methods of a Java object.
After clicking one of the items, a dialog box appears to let you specify the web service, HTTP 
service, or Java object you want to use.
3.
If you selected Web Service, select a named service from the pop-up menu or enter the URL of 
a web service’s WSDL file in the text box. 
For more information, click the Help button on the dialog box.
4.
If you selected HTTP Service, select a named service from the pop-up menu or enter the address 
of an HTTP data source in the text box.
For more information, click the Help button on the dialog box.
5.
If you selected Remote Object, select a named service from the pop-up menu or enter the 
location of the Java object or Flash Remoting service in the text box.
For more information, click the Help button on the dialog box.
After closing the dialog box, the web service, HTTP service, or remote object appears in the Data 
panel indicating that a reference to it has been inserted into the MXML file and that you can bind 
it to a component or a data model in the file. 
A Flex web service is easier to use than the other Flex data services because you can visually bind 
to the web service’s results or parameters without knowing them in advance—Flex Builder 
retrieves and displays the schema for you. Flex Builder does not retrieve and display the schema of 
HTTP services and remote objects. You must know the schema of these objects in advance to 
recreate it in your code (for visual binding), or to write the binding expression yourself.
Related topics
Binding a Flex data service to an object
After inserting a Flex data service in the MXML file, you can bind it to a property of a component 
or data model in the file.
You must create one binding to retrieve data from the data service and a separate binding to pass 
data to the data service. In either case, you must create an event handler to call the data service.
This section covers the following topics:
Retrieving data from a Flex data service
You can create bindings that retrieve data from Flex data services. For example, you can create a 
binding that retrieves weather information from a web service so that you can display it in your 
MXML file.