1 Reply Latest reply on Sep 25, 2008 10:40 AM by jamesweir

    AIR: Socket ProgressEvent.SOCKET_DATA not dispatched

    jamesweir
      Hi,

      Currently using Adobe AIR with flex 3 to communicate with a REST web service. I require to have full access to the HTTP header information to take advantage of the etag and last-modified information for caching. I started by using the URLRequest that provides the requestHeaders and using the HTTPStatusEvent with responseHeaders to retrieve the information. Unfortunately the responseHeaders are always empty, has anyone else seeing this problem ?

      I checked using a simple HTTP client, and the web service is correctly providing the HTTP headers I require.

      I decided to use sockets using the arc90 REST library:
      http://lab.arc90.com/2008/03/restservice.php

      This was all working fine...however from time to time, the response is never detected. More precisely the ProgressEvent is never fired when data is ready to read by the socket. Rooting around I seen this bug:

      http://bugs.adobe.com/jira/browse/SDK-14813

      From what it says there seems to be a problem with flash player, can anyone from Adobe provide a status on this bug ? and whether this is also impacting the behaviour i see in AIR ?

      I am testing AIR on Windows XP

      Thanks for any help
      James


        • 1. Re: AIR: Socket ProgressEvent.SOCKET_DATA not dispatched
          jamesweir Level 1
          Sorry to reply to my own questions, but thought I would post this for anyone who had the same problems as I did:

          Regarding what I said....

          " I started by using the URLRequest that provides the requestHeaders and using the HTTPStatusEvent with responseHeaders to retrieve the information. Unfortunately the responseHeaders are always empty"

          This is true if you use:
          dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

          If you wish to get the response headers in AIR, you need to use

          dispatcher.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpStatusHandler);

          Thanks for this blog entry:
          http://www.judahfrangipane.com/blog/?p=87

          Cheers
          James