MACROMEDIA FLEX-GETTING STARTED WITH FLEX Getting Started page 29

Table of Contents

Advertisement

The following figure shows the application rendered in a web browser window after the user clicks
the Submit button:
As an alternative to the curly braces ({ }) syntax, you can use the
specify the source and destination of a binding. For more information about data binding, see
Chapter 32, "Binding and Storing Data in Flex," in Developing Flex Applications.
Using data services
Flex is designed to interact with several types of services that provide access to local and remote
server-side logic. For example, a Flex application can connect to a web service that uses the Simple
Object Access Protocol (SOAP), a Java object residing on the same application server as Flex using
AMF, or an HTTP URL that returns XML. AMF is the protocol used in Flash Remoting MX.
The MXML components that provide data access are called data service components. MXML
includes the following types of data service components:
WebService
HTTPService
RemoteObject
The following example shows an application that calls a web service that provides weather
information, and displays the current temperature for a given ZIP code. The application binds
the ZIP code that a user enters in a TextInput control to a web service input parameter. It binds
the current temperature value contained in the web service result to a TextArea control.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" >
<!-- Define the web service connection
(the specified WSDL URL is not functional). -->
<mx:WebService id="WeatherService"wsdl="/ws/WeatherService?wsdl">
<!-- Bind the value of the ZIP code entered in the TextInput control
to the ZipCode parameter of the GetWeather operation. -->
<mx:operation name="GetWeather">
<mx:request>
<ZipCode>{zip.text}</ZipCode>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:Panel title="My Application" marginTop="10" marginBottom="10"
marginLeft="10" marginRight="10" >
provides access to SOAP-based web services
provides access to HTTP URLs that return data
provides access to Java objects using the AMF protocol
tag, in which you
<mx:Binding>
About MXML
29

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-GETTING STARTED WITH FLEX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flex

Table of Contents