Adding a web service to process form input data. : WebService « Data Model « Flex






Adding a web service to process form input data.

         

<!--
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/

-->


<!-- containers\layouts\FormDataSubmitServer.mxml -->
<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">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
    <fx:Script>
         
        private function processValues():void { 
            // Check to see if ZIP code is valid. 
            WeatherService.GetWeather.send(); 
        } 
      
    </fx:Script>
    <fx:Declarations>
        <!-- Define the web service connection. 
            The specified WSDL URI is not functional. -->
        <mx:WebService id="WeatherService" wsdl="/ws/WeatherService?wsdl">
            <mx:operation name="GetWeather">
                <mx:request>
                    <ZipCode>{zipCode.text}</ZipCode>
                </mx:request>
            </mx:operation>
        </mx:WebService>
    </fx:Declarations>
    <mx:Form>
        <mx:FormItem label="ZIP Code">
            <mx:TextInput id="zipCode" width="200" text="ZIP code please." />
            <mx:Button width="60" label="Submit" click="processValues();" />
        </mx:FormItem>
    </mx:Form>
    <mx:VBox>
        <mx:TextArea
            text="{WeatherService.GetWeather.lastResult.CityShortName}" />
        <mx:TextArea text="{WeatherService.GetWeather.lastResult.CurrentTemp}" />
        <mx:TextArea text="{WeatherService.GetWeather.lastResult.DayForecast}" />
    </mx:VBox>
</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 a web service and assign returning value to form controlsCall a web service and assign returning value to form controls
16.Call web service with operation defined
17.Call a web service that queries a SQL database and returns data to Flex
18.Web Service Fault EventWeb Service Fault Event
19.Web Service Multiple OperationsWeb Service Multiple Operations
20.Web Service OperationWeb Service Operation
21.Web Service Result Event
22.Web Service With Bindings
23.Web Service Bounded ParamsWeb Service Bounded Params
24.Get DataSet from ASP.net web service
25.Call Asp.net asmx web service
26.Call Asp.net web service and pass parameters
27.Use Web service to validate inputUse Web service to validate input
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