You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Fred Ross-Perry <fr...@gmail.com> on 2019/09/04 04:37:40 UTC

trouble with HTTPService

I am seeing something odd when using mx.rpc.Responder with HTTPService.
Typically I'll get an AsyncToken when sending a request, and add a 
responder to it:

     var theToken:AsyncToken = sessionService.send(some data...);
     theToken.addResponder(new mx.rpc.Responder(onPutSessionResult, 
onPutSessionFault));

And then define the functions like this:

     private function onPutSessionResult(theEvent:ResultEvent):void
     {
         //  do something with theEvent.result
         console.log("onPutSessionResult called");
     }

     private function onPutSessionFault(theEvent:FaultEvent):void
     {
         //  do something with theEvent.fault
         console.log("onPutSessionFault called");
     }

Here's what's odd. The browser (Chrome in my case) actually makes two 
requests
OPTIONS and POST. I can see in the Chrome Dev Tools that the request 
succeeded
and what the result data is.

But it looks to me like onPutSessionResult is called right after the 
OPTIONS,
and so theEvent.result is null.

This is a recent 0.9.6, building with Moonshine.

Help?

-Fred


Re: trouble with HTTPService

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I'm assuming you are using mx:HTTPService?  I think only one person is using it much, so there could certainly be bugs.  Please open an issue with a small test case.

-Alex

On 9/3/19, 9:37 PM, "Fred Ross-Perry" <fr...@gmail.com> wrote:

    I am seeing something odd when using mx.rpc.Responder with HTTPService.
    Typically I'll get an AsyncToken when sending a request, and add a 
    responder to it:
    
         var theToken:AsyncToken = sessionService.send(some data...);
         theToken.addResponder(new mx.rpc.Responder(onPutSessionResult, 
    onPutSessionFault));
    
    And then define the functions like this:
    
         private function onPutSessionResult(theEvent:ResultEvent):void
         {
             //  do something with theEvent.result
             console.log("onPutSessionResult called");
         }
    
         private function onPutSessionFault(theEvent:FaultEvent):void
         {
             //  do something with theEvent.fault
             console.log("onPutSessionFault called");
         }
    
    Here's what's odd. The browser (Chrome in my case) actually makes two 
    requests
    OPTIONS and POST. I can see in the Chrome Dev Tools that the request 
    succeeded
    and what the result data is.
    
    But it looks to me like onPutSessionResult is called right after the 
    OPTIONS,
    and so theEvent.result is null.
    
    This is a recent 0.9.6, building with Moonshine.
    
    Help?
    
    -Fred