Why are there two different HTTPService classes in Flex? this and this
And the second one inherits the first one. Why couldn't there be a single class combining the two?
One of the objects (the first link you posted) is the HTTPService Object itself.
The second is the object that wraps the HTTPService object and gives it the additional functionality for the <mxml /> tag.
The two probably weren't combined because you don't necessarily need the implementation of the IMXMLObject and IMXMLSupport interfaces every time you need an HTTService object.
mx.rpc.http.mxml.HTTPService can also handle concurrency while the other can't.
Edit:
Although in the online documentation I see concurrency as a property of both, several sources say thats not true(and my tests didn't work when I first tried using it). Also the concurrency package is only imported into the mxml.HTTPService, not the base rpc class.
Bug Comment Mederator comment on the docs page
There appear to be more error handling features in the URLLoader class. Using MXML to create your HTTPService is not a big difference though.
// ActionScript Style
private function myService():void {
var service:HTTPService = new HTTPService();
...service.parameters = value;...
service.send();
}
or
< !-- MXML Style -- >
< mx:HTTPService >
...< parameters >...
< /mx:HTTPService >
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With