views:

273

answers:

1

I created a Java REST service using Jersey. I use three of the HTTP "verbs" GET, POST and DELETE. I want to create several prototype front ends for the service. After much research, a lot dating to 2008 and 2009, I have been unable to find anything remotely simple.

My three options are:

1) resthttpservice. This project hasn't been updated in a year. The only activity are one off suggestions that individual users have implemented.

http://code.google.com/p/resthttpservice/

2) Create an AIR application. This isn't unfeasible.

3) Writing my own socket level code but there is a security restriction with flash players and I need to implement a policy server.

I have already read the question posted about asking whether using Flex for REST services were worth it. That information is old as well. I want to introduce REST services to my company but Flex's limited support for HTTP PUT and DELETE are discouraging. My service also uses the Accept header to determine if JSON or XML will be returned to the client. I can't seem to change HTTP headers without doing socket programming. I'm fine with that but the security policy thing is annoying.

Is there an easy way to use Flex 4 with RESTful services that uses PUT/DELETE and the Accept HTTP header?

Please help. I'm very frustrated.

A: 

I would suggest using BlazeDS as a proxy. Also read this discussion from stackoverflow.

Cornel Creanga
I looked through the BlazeDS documentation and I can use it as a proxy but using HttpService I can't set HTTP headers. My only option using Flex and keeping my code as RESTful as possible would be to create some java code that Flex will call. I will then use HTTPClient to send a HTTP request to the service.