Here's an example with code that I've used in the past:
var myXml:XML = new XML();
public var service:WebService = new WebService();
service.wsdl = "http://pathToYourWsdl";
service.SomeWebMethod.resultFormat = "e4x";
service.SomeWebMethod.addEventListener("result", resultHandler);
service.SomeWebMethod.addEventListener("fault", faultHandler);
service.addEventListener(LoadEvent.LOAD, serviceLoadHandler);
service.loadWSDL();
protected function serviceLoadHandler(event:LoadEvent):void
{
service.SomeWebMethod.send();
}
protected function resultHandler(event:ResultEvent):void
{
myXML = XML(event.result);
}
protected function faultHandler(event:FaultEvent):void
{
// Handle a service fault here.
}
This code handles all service calls Asynchronously and then assigns the result of your method call to the XML variable. It's pretty self explanitory. "SomeWebMethod" would be the name of the Web Method in your service to call. If it needs parameters, they get added like so:
service.SomeWebMethod.send(param1, param2, ...);