On Mon, Jan 25, 2010 at 9:24 AM, Andres P. Ferrando <and...@pruna.com.ar> wrote:
> Hi,
>
> I've been looking at the binding docs, and for instance in http binding
> (http://tuscany.apache.org/sca-java-bindinghttp.html), it asks that the
> service either implements javax.servlet.Servlet interface or use a
> collection interface that matches the actions of the HTTP protocol (methods
> get, post, etc). Similar requirements exists for other bindings.
>
> One of the main ideas behind SCA is to hide binding info from
> implementation.
>
> So, if for instance I have an existent class with a single method that I
> want to expose only through GET, and doesn't follows any of these
> requirements, which is the best approach? Create a "proxy" SCA component? Or
> is there any way to define this in the binding itself? Or some other option
> I didn't see?
>

Hi Andrés

   The REST style services work a little different, as there is a need
to have a direct mapping to REST/HTTP operations, and based on this,
our HTTP and ATOM bindings have some specific behavior to accomodate
this requirement. One of the things I'm looking at, is to support
JAX-RS in Tuscany, where you would be able to map your business
interfaces to these REST/HTTP operations via annotations more like :

public interface Catalog {
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    Item[] getMyCatalog();
}

   Back to your issue, how does your method signature looks like ?
But, for now, a proxy component might be the simplest solution.

-- 
Luciano Resende
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Reply via email to