apache-flexairhttprequest

Flex HTTPService times out anyway


I'm getting an error after 30 seconds of execution of this service

<s:HTTPService id="svcList" url="http://localhost/index.php" method="GET" result="svcList_resultHandler(event)" fault="svcList_faultHandler(event)" requestTimeout="300">
    <s:request xmlns="">
        <mod>module</mod>
        <op>operation</op>
    </s:request>
</s:HTTPService>

This operation takes longer than usual so I changed the max execution time for php to 120 seconds.

The script runs correctly when is requested through a browser i.e http://localhost/index.php?mod=module&op=operation

I've already checked the fault event object for an answer and find this at faultDetails Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/index.php" errorID=2032]. URL: http://localhost/index.php

Is there a execution time limit for requests ?

Edit: Using requestTimeout already.

Thanks


Solution

  • Ok, in my working environment (Flex SDK 4.1 - AIR 2.6) simply using requestTimeout="xx" doesn't work I don't know why.

    But setting a very global object URLRequestDefaults property idleTimeout works as I need.

    The solution for my proble is this configuration, at the top of the application.

    import flash.net.URLRequestDefaults;
    
    URLRequestDefaults.idleTimeout = 120000; //note this value represents milliseconds (120 secs)
    

    I believe this could help somebody.