This code works just fine: var envelope:XML = <soap-env:Envelope xmlns:tpro="http://aplaud.com/ns/0.1/tts/profile" xmlns:tf="http://aplaud.com/ns/0.1/tts/format" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Header>{SomeHeadXML}</soap-env:Header> <soap-env:Body>{SomeBodyStuff}</soap-env:Body> </soap-env:Envelope>; var url:String = "http://my_domain/bleh.php"; var callback:Function = handleBlehResponse; ur.method = URLRequestMethod.POST; ur.url = url; ur.data = envelope; ur.requestHeaders.push(RH); var ul:URLLoader = new URLLoader(ur); ul.addEventListener(Event.COMPLETE,callback); ul.load(ur);
But I have many of these to write so I would like to place the soap- env in a CONSTANT (in the super) and add HEADER and BODY nodes later. Something like this... static public var ENVELOPE:XML = <soap-env:Envelope xmlns:tpro="http://aplaud.com/ns/0.1/tts/profile" xmlns:tf="http://aplaud.com/ns/0.1/tts/format" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Header></soap-env:Header> <soap-env:Body></soap-env:Body> </soap-env:Envelope>; var env = new XML(ENVELOPE.toString()); var soap-env:Namespace = new Namespace ("http://schemas.xmlsoap.org/soap/envelope/"); env::soap-env.Header = SomeHeadStuff; env::soap-env.Body = SomeBodyStuff; I think the trouble is with namespaces, but I have no idea how to specify a hyphenated namespace "soap-env" or if I even need to. TIA

