2 Replies Latest reply on Mar 12, 2010 2:48 AM by PDL_AGH

    When is a HTTPService calling the result method?

    PDL_AGH

      Hello,

       

      I am using several HTTPServices, that work but are called through mx: components.

       

      I am using this HTTPService to load some XML in exactly the same manner, exept I try to access the resulting XML directly without calling any component:

       

          <mx:HTTPService id="serviceRuleTemplate"
              resultFormat="e4x"
              url="{'http://somehost:8080/RestfullMiddleware/rule-templates/'+sRuleTempPath}"
              result="ruleTemplateResultHandler(event);"
              fault="collectionFaultHandler(event);"/>

       

         [Bindable]
         private var xmlRuleTemplate:XML;

       

         // Result handler - gets called after XML is loaded.
         private function ruleTemplateResultHandler(event:ResultEvent):void{
              xmlRuleTemplate = event.result as XML;
         }

       

      Later in the code i set the url variable and I call the service:

       

        sRuleTempPath = event.target.label;
        serviceRuleTemplate.send();

       

      Yet when I check the value of xmlRuleTemplate immediatly after the send(), it shows as null.

       

      Is there something more I need to add for the result method (ruleTemplateResultHandler) to be called?

       

      All the best,

      Pierre