I am a big fan of Flex until now and the reason is the HTTPService that Flex provides doesn’t play well with REST. You see I am developing an application that uses Jersey/Spring/JPA on the server side and my plan was to use Flex to talk to the server side using Restful style web services. The problem is HTTPService class has several major limitations:
- Only GET and POST methods are supported out of the box (unless you use FDS and set useProxy attribute to true)
- Not able to set request headers and there is no access to response headers. Therefore I am not able to access the response body in the case of an error.
- It HTTPService gets a status code anything other 200, it consider an error. (event 201, ouch!!). The FaultEvent doesn’t provide information about the status code any response body. The Flex client will have no idea what went wrong.
I have spent quite a bit of time reading blogs after blogs about these issues and I don’t see an clean solution out there yet. Here is a list of blogs that talk about the very same issues that I listed above
I am doing research for a couple more days and if I can’t find anything clean solution to overcome these limitations, I am afraid Flex will not be used in this project. This is really disappointing!!
Drop me a note if you know any tips or tricks to overcome the limitations of HTTPService.