A load event for WebService : WebService « Data Model « Flex






A load event for WebService

A load event for WebService
          
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:WebService id="WeatherService" 
                   wsdl="/WeatherService?wsdl" 
                   result="successfulCall();" 
                   fault="errorCall();">
        <mx:operation name="GetWeather">
            <mx:request>
                <ZipCode>{zipCode.text}</ZipCode>
            </mx:request>
        </mx:operation>
    </mx:WebService>
    <mx:Script>
        
        import mx.controls.Alert;
        private function processValues():void {
            WeatherService.GetWeather.send();
        }
        private function successfulCall():void {
            vs1.selectedIndex=1;
        }
        private function errorCall():void {
            Alert.show("Web service failed!", "Alert Box", Alert.OK);
        }
      
    </mx:Script>
    <mx:ViewStack id="vs1">
        <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:VBox>
    </mx:ViewStack>
</mx: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 fault event for WebServiceA fault event for WebService
3.Call service with WebService
4.Call web service wsdl with WebService and operation in MXML
5.Call WebService with ActionScript
6.Call WebService with operation names
7.Explicit parameter passing with RemoteObject and WebService componentsExplicit parameter passing with RemoteObject and WebService components
8.Define name space for WebServiceDefine name space for WebService
9.WebService error eventWebService error event
10.Get result for WebService callGet result for WebService call
11.Convert returning value from WebService to ArrayCollectionConvert returning value from WebService to ArrayCollection
12.Call a web service
13.Use a web service to process form input dataUse a web service to process form input data
14.Call a web service and assign returning value to form controlsCall a web service and assign returning value to form controls
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