1 Reply Latest reply on Dec 17, 2007 4:11 PM by Peter Farland

    HTTPService fails to recognize HTTP Errors

      I have a web service which, under certain (appropriate) circumstances, will return with an HTTP status code of 404 and a status description which provides a detailed error message. Invoking this service from a variety of languages (perl, vba, c#, java) results in the proper handling of such an event on the client side.

      However, with HTTPService (Flex 2 *AND* Flex 3), I appear to have no access to the underlying status code and description. Instead, my fault handler reveals only:
      faultCode = Server.Error.Request
      faultDetail = Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/myUrl" URL: http://localhost/myUrl
      faultString = HTTP request error

      Searching the web, this appears to be a known limitation of HTTPService, and *MANY* flex developers are complaining about it. Yet the recommended workaround is to always return 200 from the web service and simply embed a useful error message in the returning payload. This works, but ruins things for the rest of the non-flex consumers whose native http request objects correctly handle things. And of course, it doesn't work if we don't control the web service.

      Can someone from ADOBE please weigh in here? If this is known behavior, why, and what can be done to correct it?
        • 1. Re: HTTPService fails to recognize HTTP Errors
          Peter Farland Level 3
          I understand your frustration, but unfortunately it is not something that Flex can control. It's a limitation of the browser plugin-APIs exposed to the Flash Player. We're hoping to work through these issues but it's a long process.

          Could you possibly detect that the Flash Player is making the request and conditionally use a 200 status code, allowing the non-200 status codes to be used for other clients?

          If you do not control the status code, then another work around is to use a proxy to do this status translation for you. If you do not wish to develop your own proxy for this issue, note that the ProxyService originally from LCDS has been exposed through the new BlazeDS offering - this project as you may be aware has been announced as an open source effort and the beta is on Adobe Labs.