Hey guys,
Transforming some SOAP web services in to REST. It's been a painless process although I've encountered a problem in exposing a stateless session bean as a RESTful web service. Basically if the bean implements an interface and also has Jersey annotations it will not deploy with a object is not of declaring class
error. Remove the interface and it works fine.
@Path("/myService")
@Stateless(name = "MyService")
public class myServiceBean implements myService {
@GET
@Path("{myService}")
@Produces(MediaType.TEXT_PLAIN)
public String helloWorld(@PathParam("myService") String message){
return message;
}
}
A footnote: Annotating interfaces - yay or nay? I'd say no - I like to keep my API's as clean as possible.