Hey Paul.
The first thing you need to do is set up the Flex object to handle the web
service, it might look something like this:
<mx:WebService id="WeatherService"
wsdl="http:/example.com/ws/WeatherService?wsdl" useProxy="false" />
Then you simply would call methods on the web service in AS. Inside a
method (say a click handler for a button) you might have something that
looks like:
WeatherService.getWeather(25414);
There are several ways you can handle the results of this, you can:
1. using Flex bindings: <mx:Text text="{
WeatherService.getWeather.lastResult.someInfo"} />
2. You can use <mx:operation> inside of the <mx:webService> tag to
specify which methods to call when results are returned.
<mx:WebService id="WeatherService"
wsdl="http:/example.com/ws/WeatherService?wsdl" useProxy="false" >
<mx:operation name="getWeather" result="weatherHandler(event)" />
</mx:webService>
In the last example, when the method getWeather() of the weatherService is
called, and data is returned, the method weatherHandler() is called. The
argument passed to weatherHandler is of type event, the data you would want
would be in event.result, for example:
private function weatherHandler(event:Event):void{
var the result = event.result;
}
Hope this helps.
On 1/31/07, Paul Ihrig <[EMAIL PROTECTED]> wrote:
>
> does any one have any info on consuming a web service in flex 2?
> i have googled it & can only find a few course outlines.
>
> the help file in flex builder only refers to cf & dreamweaver, which i
> have
> already done in very basic cf.
> that little app i showed yesterday that was ugly.
>
> would like to do it over in flex.
> but cant figure out where to get started.
>
> thanks
> -paul
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:226281
Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5