views:

77

answers:

2

I don't think my HTTP is being called properly and I am trying to set a break in the HTTP. What is the correct way to do this?

A: 

Your parse error is probably because the resultFormat property of HTTPService is not being set. What sort of data are you trying to retrieve? Look up the documentation and try to set resultFormat to an appropriate value (i.e. one of e4x, xml, text, etc.)

Define a resultHandler and faulthandler. Then set breakpoints in both these functions.

<HTTPService id="myservice" 
             ... 
             resultType="e4x" 
             result="resultHandler(event)" fault="faultHandler(event)"/>
<mx:Script> 
... 
    private function resultHandler(e:ResultEvent):void {
            trace(e.result); // set breakpoint here
    }


    private function resultHandler(e:FaultEvent):void {
            var faultstring:String = event.fault.faultString; // and here
            Alert.show(faultstring); 
    }
dirkgently
I tried to set the breakpoint and I'm not able to release the build due to an error. I will update with the error I am receiving.
LaBopeep
I couldn't copy the error, but the error was a parse error at the result handler. Does this mean the breakpoint was inserted incorrectly?
LaBopeep
No, a compile time error has nothing to do with breakpoints. See updated answer.
dirkgently
A: 

One additional thing you could try if you're not getting what you expect back in the resultHandler() would be to use an HTTP or network sniffer to see what is being transmitted.

I prefer Wireshark, but it's a little hard-core. Fiddler is also good for HTTP traffic.

Dan R