Call a web service and assign returning value to form controls : WebService « Data Model « Flex






Call a web service and assign returning value to form controls

Call a web service and assign returning value to form controls
         


<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->

 

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark">
    <fx:Declarations>
        <s:WebService id="WeatherService"
            wsdl="http:/example.com/ws/WeatherService?wsdl" useProxy="false">
            <s:operation name="GetWeather">
                <s:request>
                    <ZipCode>{zip.text}</ZipCode>
                </s:request>
            </s:operation>
        </s:WebService>
    </fx:Declarations>
    <s:Panel title="My Application">
        <s:VGroup left="10" right="10" top="10" bottom="10">
            <!-- Provide a ZIP code in a TextInput control. -->
            <s:TextInput id="zip" width="200" text="Zipcode please?" />
            <!-- Call the web service operation with a Button click. -->
            <s:Button width="60" label="Get Weather"
                click="WeatherService.GetWeather.send();" />
            <!-- Display the location for the specified ZIP code. -->
            <s:Label text="Location:" />
            <s:TextArea
                text="{WeatherService.GetWeather.lastResult.Location}" />
            <!-- Display the current temperature for the specified ZIP code. -->
            <s:Label text="Temperature:" />
            <s:TextArea
                text="{WeatherService.GetWeather.lastResult.CurrentTemp}" />
        </s:VGroup>
    </s:Panel>
</s:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Feed returning value from WebService to a DataGridFeed returning value from WebService to a DataGrid
2.A load event for WebServiceA load event for WebService
3.A fault event for WebServiceA fault event for WebService
4.Call service with WebService
5.Call web service wsdl with WebService and operation in MXML
6.Call WebService with ActionScript
7.Call WebService with operation names
8.Explicit parameter passing with RemoteObject and WebService componentsExplicit parameter passing with RemoteObject and WebService components
9.Define name space for WebServiceDefine name space for WebService
10.WebService error eventWebService error event
11.Get result for WebService callGet result for WebService call
12.Convert returning value from WebService to ArrayCollectionConvert returning value from WebService to ArrayCollection
13.Call a web service
14.Use a web service to process form input dataUse a web service to process form input data
15.Call web service with operation defined
16.Call a web service that queries a SQL database and returns data to Flex
17.Web Service Fault EventWeb Service Fault Event
18.Web Service Multiple OperationsWeb Service Multiple Operations
19.Web Service OperationWeb Service Operation
20.Web Service Result Event
21.Web Service With Bindings
22.Web Service Bounded ParamsWeb Service Bounded Params
23.Get DataSet from ASP.net web service
24.Call Asp.net asmx web service
25.Call Asp.net web service and pass parameters
26.Use Web service to validate inputUse Web service to validate input
27.Adding a web service to process form input data.
28.Call WSDL serviceCall WSDL service
29.Call method in WSDL file
30.Create a namespace object for soap:BodyCreate a namespace object for soap:Body