Hi [again] flexcoders,
Is there a trick to using the HTTPService class in a pure AS class, ie without the mx:HTTPService tag? Everything seems to work up until I invoke send(), at which point nothing gets sent (no HTTP debug output as I get when using it through the MXML tag) and the fault event fires saying "Could not retrieve data". Here's what I've got:
import mx.servicetags.HTTPService;
class PortfolioDAO {var editService:HTTPService;
function PortfolioDAO() {
editService = new HTTPService(); // maybe this constructor needs arguments?
editService.serviceName="portfolio"; // this is set up in flex-config.xml and works when using mx:HTTPService
editService.method="POST"
editService.contentType="application/xml"
editService.showBusyCursor=true;
editService.xmlEncode=encodeSaveRequest; // this is defined in the class and I can verify that it does get called and returns the correct result
editService.addEventListener("result", handleResult); // these are defined in the class
editService.addEventListener("fault", handleFault);
}
public function moveEntry(entry:PortfolioEntryModel, newPortfolioName:String):Void {
entry.portfolioName = newPortfolioName;
editService.request = entry; // this causes encodeSaveRequest to be called properly
editService.send(); // nothing gets sent, and then the fault event gets thrown
}
... }
Any ideas? Thanks
- rdo

