How do you properly handle HTTPService calls that never return with Result or Error? I have one that repeatedly sits and sits, never coming back from the server.
If I set timeout, that's fine, but then how to gracefully tell the user the call has been timed out?
Views
Replies
Total Likes
If you set requestTimeout then your request will raise a fault when it times out so you can just add an event listener to the httpservice faultevent and could display an Alert with some info for the user.
Views
Replies
Total Likes
Is there somethign special I have to do to get the fault to raise...? Because I have a fault event defined for my service, and I set the timeout seconds, but nothing happens...???
Views
Replies
Total Likes
Could you post how do you declare your httpservice? and how do you add the service event listener? and the event listeners as well?
Views
Replies
Total Likes
Sure:
private
function sendID1(id:String):void{
var params:Object = newObject();
params.p_id=id;
httpSvcGetName1.send(params);
}
private function svcGetName1Result(evt:ResultEvent):void{
varresultObj:Object = evt.result;
/* Assign the values... */
//Alert.show(resultObj.toString());
lblName1.text=resultObj.toString();
}
public function svcFault1(faultEvent:FaultEvent):void{
varfaultstring:String = faultEvent.fault.rootCause.toString();
Alert.show(faultstring,'Fault');
MXML:
<mx:HTTPService
id="
httpSvcGetName1"
url="
http://myservice.P_GET_FULLNAME"
showBusyCursor="
true"
requestTimeout="
10"
resultFormat="
text
"
fault="svcFault1(event)"
result="svcGetName1Result(event)"
/>
Views
Replies
Total Likes
Your code looks ok, have you tried debugging your app and setting breakpoints in the result and fault handlers to see if the response hit one of these?
Views
Replies
Total Likes
Well, I did put "alerts" in the Fault handler, and it never gets called...the hourglass (clock) comes up for 10 seconds (or whatever I set the timeout to), then just simply goes away...
Views
Replies
Total Likes
This issue still plagues me...
Only occasionaly, but it still happens that my service never responds, and just sits.
Any suggestions...
BUMP!
Views
Replies
Total Likes
Views
Likes
Replies