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
2009-02-28 20:19:00
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
2009-03-01 01:56:28
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
2009-03-01 02:03:26
No, a compile time error has nothing to do with breakpoints. See updated answer.
dirkgently
2009-03-01 08:08:21
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
2009-03-01 01:11:00